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)

'Declaration
Public Event Stopped As EventHandler(Of WorkflowRuntimeEventArgs)
'Usage
Dim instance As WorkflowRuntime 
Dim handler As EventHandler(Of WorkflowRuntimeEventArgs)

AddHandler instance.Stopped, handler

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 
Dim workflowRuntime As New WorkflowRuntime()
' Add a method as the event handler for the Stopped event. 
AddHandler workflowRuntime.Stopped, AddressOf RuntimeStopped

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0
Show: