WorkflowRuntime.Started 事件
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
在工作流程執行階段引擎啟動時發生。
public:
event EventHandler<System::Workflow::Runtime::WorkflowRuntimeEventArgs ^> ^ Started;
C#
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 事件中。 在這個範例中,處理常式是列印簡易訊息至主控台的匿名方法。
C#
// 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 類別之服務所實作的方法,並且已設定 IsStarted 為 true
。 工作流程執行階段引擎啟動衍生自 WorkflowRuntimeService 類別的服務時,無法保證其順序。而且這些工作流程執行階段引擎服務的其中一些服務,可能需要依賴其中的其他服務所提供的功能,來完成各自的啟動工作。 工作流程執行階段引擎服務可以覆寫 WorkflowRuntimeService.OnStarted 方法,以便在 Started 事件引發時,執行需要其他工作流程執行階段引擎服務支援的任何最後啟動工作。
如需處理事件的詳細資訊,請參閱 處理和引發事件。
產品 | 版本 |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |