This documentation is archived and is not being maintained.

WorkflowRuntime.Stopped Event

Occurs when the workflow runtime engine is stopped.

Namespace: System.Workflow.Runtime
Assembly: System.Workflow.Runtime (in system.workflow.runtime.dll)

public event EventHandler<WorkflowRuntimeEventArgs> Stopped
/** @event */
public void add_Stopped (EventHandler<WorkflowRuntimeEventArgs> value)

/** @event */
public void remove_Stopped (EventHandler<WorkflowRuntimeEventArgs> value)

In JScript, you can handle the events defined by a class, but you cannot define your own.
Not applicable.

The StopRuntime method raises the Stopped event after it has invoked the Stop method implemented by each of its services that derive from the WorkflowRuntimeService class. There is no guarantee about the order in which these workflow runtime engine services are stopped, and some of these services may need to preserve some functionality that is relied on by other services until they too are stopped. Such services can override the WorkflowRuntimeService.OnStopped method in order to perform any residual shutdown logic when the Stopped event is raised.

For more information about handling events, see Consuming Events.

In the following example, an event handler is added to the Stopped event of the WorkflowRuntime. In this example, the handler is an anonymous method that prints a simple message to the console.

// 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."); });

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0