WorkflowRuntimeService.State 屬性

定義

取得 WorkflowRuntimeService 的狀態。Gets the state of the WorkflowRuntimeService.

protected:
 property System::Workflow::Runtime::Hosting::WorkflowRuntimeServiceState State { System::Workflow::Runtime::Hosting::WorkflowRuntimeServiceState get(); };
protected System.Workflow.Runtime.Hosting.WorkflowRuntimeServiceState State { get; }
member this.State : System.Workflow.Runtime.Hosting.WorkflowRuntimeServiceState
Protected ReadOnly Property State As WorkflowRuntimeServiceState

屬性值

備註

WorkflowRuntimeService 類別會實作用於啟動和停止工作流程執行階段引擎服務的兩階段機制。The WorkflowRuntimeService class implements two-phase mechanisms for both starting and stopping a workflow runtime engine service. 啟動機制的第一個階段會從工作流程執行階段引擎呼叫服務的 Start 方法實作時開始。The first phase of the start mechanism begins when the workflow runtime engine calls the implementation of the Start method for the service. 此方法應呼叫 Start 的基底實作,將 State 設定為 StartingThis method should call the base implementation of Start, which sets State to Starting. 第二個階段發生在工作流程執行階段引擎在引發 Started 事件時,並啟動所有工作流程執行階段引擎服務後。The second phase occurs after the workflow runtime engine starts all of its workflow runtime engine services when it raises the Started event. WorkflowRuntimeService 在內部管理此事件的訂閱,而且其處理常式會將 State 設定為 StartedThe WorkflowRuntimeService internally manages a subscription to this event and its handler will set State to Started.

停止工作流程執行階段引擎服務的兩階段機制會在工作流程執行階段引擎呼叫服務的 Stop 方法實作時開始。The two-phase mechanism for stopping a workflow runtime engine service begins when the workflow runtime engine calls the implementation of the Stop method for the service. 此方法應呼叫 Stop 的基底實作,將 State 設定為 StoppingThis method should call the base implementation of Stop, which sets State to Stopping. 在停止所有工作流程執行階段引擎服務後,工作流程執行階段引擎會引發 Stopped 事件。After it has stopped all of its workflow runtime engine services, the workflow runtime engine raises the Stopped event. WorkflowRuntimeService 在內部管理此事件的訂閱,而且其處理常式會將 State 設定為 StoppedThe WorkflowRuntimeService internally manages a subscription to this event and its handler will set State to Stopped.

適用於