var wfApp = new WorkflowApplication(flowObject, inputs); var syncConext = SynchronizationContext.Current; wfApp.SynchronizationContext = syncConext; wfApp.PersistableIdle = (e) => { insUnloaded.Set(); return PersistableIdleAction.Unload; }; wfApp.OnUnhandledException = (e) => { return UnhandledExceptionAction.Terminate; }; wfApp.Aborted = (args) => { syncConext.OperationCompleted(); }; wfApp.Unloaded = (e) => { insUnloaded.Set(); }; wfApp.Completed = (e) => { syncConext.OperationCompleted(); }; wfApp.Run(); insUnloaded.WaitOne();
public class PortalActivity : NativeActivity { protected override void Execute(NativeActivityContext context) { // SysPrincipal is a customized principal that implemented the IPrincipal interface, // the CurrentPrincipal of main thread has been set as this type of principal // here return null var principal = Thread.CurrentPrincipal as SysPrincipal; // .... } protected override bool CanInduceIdle { get { return true; } } #endregion }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)