本文整理匯總了C#中System.Workflow.Runtime.Tracking.TrackingService.TrackingService構造函數的典型用法代碼示例。如果您正苦於以下問題:C# TrackingService構造函數的具體用法?C# TrackingService怎麽用?C# TrackingService使用的例子?那麽, 這裏精選的構造函數代碼示例或許可以為您提供幫助。
在下文中一共展示了TrackingService構造函數的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: using
//引入命名空間
using (WorkflowRuntime workflowRuntime = new WorkflowRuntime())
{
AutoResetEvent waitHandle = new AutoResetEvent(false);
NameValueCollection parameters = new NameValueCollection();
parameters.Add("EventSource", eventSource);
workflowRuntime.AddService(new TerminationTrackingService(parameters));
workflowRuntime.WorkflowCompleted += delegate(object sender, WorkflowCompletedEventArgs e) { waitHandle.Set(); };
workflowRuntime.WorkflowTerminated += delegate(object sender, WorkflowTerminatedEventArgs e)
{
Console.WriteLine(e.Exception.Message);
waitHandle.Set();
};
WorkflowInstance instance = workflowRuntime.CreateWorkflow(typeof(SampleWorkflow));
instance.Start();
waitHandle.WaitOne();
}