WorkflowRuntime.Started 事件
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
启动工作流运行时引擎时发生。
public:
event EventHandler<System::Workflow::Runtime::WorkflowRuntimeEventArgs ^> ^ Started;
public event EventHandler<System.Workflow.Runtime.WorkflowRuntimeEventArgs> Started;
member this.Started : EventHandler<System.Workflow.Runtime.WorkflowRuntimeEventArgs>
Public Custom Event Started As EventHandler(Of WorkflowRuntimeEventArgs)
Public Event Started As EventHandler(Of WorkflowRuntimeEventArgs)
事件类型
示例
在下面的示例中,将向 Started 的 WorkflowRuntime 事件添加一个事件处理程序。 在此示例中,处理程序是向控制台输出简单消息的匿名方法。
// Create a new workflow runtime
WorkflowRuntime startingRuntime = new WorkflowRuntime();
// Add an anonymous method as the event handler for the Started event.
startingRuntime.Started += new EventHandler<WorkflowRuntimeEventArgs>(
delegate { Console.WriteLine("Workflow runtime started."); });
' Create a new workflow runtime
Dim startingRuntime As New WorkflowRuntime()
' Add a method as the event handler for the Started event.
AddHandler startingRuntime.Started, AddressOf RuntimeStarted
注解
方法 StartRuntime 在验证工作流运行时引擎的核心服务配置后引发 Started 事件,调用 Start 由派生自 WorkflowRuntimeService 类的每个服务实现的方法,并将 设置为 IsStartedtrue。 工作流运行时引擎并不按照固定顺序启动派生自 WorkflowRuntimeService 类的服务,一部分工作流运行时引擎服务可能需要依赖另一部分服务所提供的功能来完成其启动任务。 引发 WorkflowRuntimeService.OnStarted 事件后,工作流运行时引擎服务可以重写 Started 方法,以执行需要其他工作流运行时引擎服务支持的任何最终启动任务。
有关处理事件的详细信息,请参阅 处理和引发事件。