TrackingService Constructor
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
When implemented in a derived class, initializes a new instance of the TrackingService class.
protected:
TrackingService();
protected TrackingService ();
Protected Sub New ()
Examples
The following example shows how to create a new instance of a TerminationTrackingService
object, of a type that derives from TrackingService
. This sample is from the Termination Tracking Service SDK sample. For more information, see Termination Tracking Service Sample.
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();
}
Using workflowRuntime As New WorkflowRuntime()
Dim waitHandle As New AutoResetEvent(False)
Dim parameters As New NameValueCollection()
parameters.Add("EventSource", eventSource)
workflowRuntime.AddService(New TerminationTrackingService(parameters))
AddHandler workflowRuntime.WorkflowCompleted, AddressOf WorkflowRuntime_WorkflowCompleted
AddHandler workflowRuntime.WorkflowTerminated, AddressOf WorkflowRuntime_WorkflowTerminated
Dim instance As WorkflowInstance = workflowRuntime.CreateWorkflow(GetType(SampleWorkflow))
instance.Start()
waitHandle.WaitOne()
End Using
Applies to
Feedback
https://aka.ms/ContentUserFeedback.
Kommer snart: I hele 2024 udfaser vi GitHub-problemer som feedbackmekanisme for indhold og erstatter det med et nyt feedbacksystem. Du kan få flere oplysninger under:Indsend og få vist feedback om