WorkflowRuntime.WorkflowStarted 事件
定义
在启动工作流实例后发生。Occurs when a workflow instance has been started.
public:
event EventHandler<System::Workflow::Runtime::WorkflowEventArgs ^> ^ WorkflowStarted;
public event EventHandler<System.Workflow.Runtime.WorkflowEventArgs> WorkflowStarted;
member this.WorkflowStarted : EventHandler<System.Workflow.Runtime.WorkflowEventArgs>
Public Custom Event WorkflowStarted As EventHandler(Of WorkflowEventArgs)
Public Event WorkflowStarted As EventHandler(Of WorkflowEventArgs)
事件类型
示例
下面的代码示例演示如何使用工作流宿主中的 WorkflowRuntime 功能。The following code example demonstrates how to use WorkflowRuntime functionality from a workflow host. 该代码将 WorkflowStarted 与一个事件处理程序即一个名为 OnWorkflowStarted 的方法相关联。The code associates the WorkflowStarted with an event handler, a method named OnWorkflowStarted.
此代码示例是 主机通信示例的一部分。This code example is part of the Host Communication Sample.
workflowRuntime.WorkflowStarted += OnWorkflowStarted;
注解
通过计划要执行的根活动启动工作流实例后,工作流运行时引擎将引发 WorkflowStarted 事件。The workflow run-time engine raises the WorkflowStarted event after the workflow instance is started by scheduling the root activity for execution. 在此事件中,发送方包含 WorkflowRuntime,而 WorkflowEventArgs 包含与事件关联的 WorkflowInstance。For this event, the sender contains the WorkflowRuntime and WorkflowEventArgs contains the WorkflowInstance associated with the event.
有关处理事件的详细信息,请参阅 处理和引发事件。For more information about handling events, see Handling and raising events.