WorkflowRuntime.Started 事件

定義

在工作流程執行階段引擎啟動時發生。

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) 

事件類型

範例

在下列範例中,會將事件處理常式加入至 StartedWorkflowRuntime 事件中。 在這個範例中,處理常式是列印簡易訊息至主控台的匿名方法。

// 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

備註

方法 StartRuntimeStarted 在驗證工作流程執行時間引擎的核心服務組態之後引發 事件、 Start 已叫用其每個衍生自 WorkflowRuntimeService 類別之服務所實作的方法,並且已設定 IsStartedtrue 。 工作流程執行階段引擎啟動衍生自 WorkflowRuntimeService 類別的服務時,無法保證其順序。而且這些工作流程執行階段引擎服務的其中一些服務,可能需要依賴其中的其他服務所提供的功能,來完成各自的啟動工作。 工作流程執行階段引擎服務可以覆寫 WorkflowRuntimeService.OnStarted 方法,以便在 Started 事件引發時,執行需要其他工作流程執行階段引擎服務支援的任何最後啟動工作。

如需處理事件的詳細資訊,請參閱 處理和引發事件

適用於