WorkflowRuntime.Stopped イベント

定義

ワークフロー ランタイム エンジンが停止すると発生します。

public:
 event EventHandler<System::Workflow::Runtime::WorkflowRuntimeEventArgs ^> ^ Stopped;
public event EventHandler<System.Workflow.Runtime.WorkflowRuntimeEventArgs> Stopped;
member this.Stopped : EventHandler<System.Workflow.Runtime.WorkflowRuntimeEventArgs> 
Public Custom Event Stopped As EventHandler(Of WorkflowRuntimeEventArgs) 
Public Event Stopped As EventHandler(Of WorkflowRuntimeEventArgs) 

イベントの種類

次の例では、StoppedWorkflowRuntime イベントにイベント ハンドラーが追加されています。 この例では、このハンドラーはコンソールに簡単なメッセージを出力する匿名メソッドです。

// Create a new workflow runtime
WorkflowRuntime workflowRuntime = new WorkflowRuntime();
// Add an anonymous method as the event handler for the Stopped event.
workflowRuntime.Stopped += new EventHandler<WorkflowRuntimeEventArgs>(
    delegate { Console.WriteLine("Workflow runtime stopped."); });
' Create a new workflow runtime
Dim workflowRuntime As New WorkflowRuntime()
' Add a method as the event handler for the Stopped event.
AddHandler workflowRuntime.Stopped, AddressOf RuntimeStopped

注釈

StopRuntime メソッドは、Stopped クラスから派生したその各サービスによって実装された Stop メソッドを呼び出した後に、WorkflowRuntimeService イベントを発生させます。 ワークフロー ランタイム エンジンのこれらのサービスが停止する順序に関する保証はありません。また、これらのサービスによっては、他のサービスが依存する機能を、そのサービスが停止するまで保持しておくことが必要な場合があります。 そのようなサービスは、WorkflowRuntimeService.OnStopped イベントが発生したときに残りのシャットダウン ロジックを実行するように Stopped メソッドをオーバーライドできます。

イベントの処理の詳細については、「イベントの 処理と発生」を参照してください。

適用対象