WorkflowRuntimeService.OnStopped Method ()
When overridden in a derived class, represents the method that will be called when the workflow runtime engine raises the WorkflowRuntime.Stopped event.
Assembly: System.Workflow.Runtime (in System.Workflow.Runtime.dll)
The WorkflowRuntimeService class implements a two-phase stopping mechanism so that workflow runtime engine services may retain some functionality after their Stop method is invoked by the workflow runtime engine in order that they may, if necessary, support the shutdown of other services. After the workflow runtime engine has called the Stop method of all of its workflow runtime engine services, it raises the WorkflowRuntime.Stopped event. You can override the method to provide any final shutdown functionality required by your service when the WorkflowRuntime.Stopped event is raised. The mechanics of subscribing and unsubscribing from the WorkflowRuntime.Stopped event is handled internally.
If your WorkflowRuntimeService is removed from the workflow runtime engine by a call to RemoveService while the workflow runtime engine is running, the workflow runtime engine will call Stop on your service. However, in this situation, the method will not be called for your service. Therefore, your service may have to perform any final shutdown that it would ordinarily perform in from inside the Stop method. You can test IsStarted to determine whether the workflow runtime engine is running.
Available since 3.0