WorkflowRuntime.Stopped Event

Definition

Si verifica quando il motore di runtime del flusso di lavoro viene arrestato.Occurs when the workflow run-time engine is 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) 

Examples

Nell'esempio seguente un gestore eventi viene aggiunto all'evento Stopped di WorkflowRuntime.In the following example, an event handler is added to the Stopped event of the WorkflowRuntime. In questo esempio, il gestore è un metodo anonimo che visualizza un semplice messaggio sulla console.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."); });
' 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

Remarks

Il metodo StopRuntime genera l'evento Stopped dopo aver richiamato il metodo Stop implementato da ognuno dei servizi che derivano dalla classe WorkflowRuntimeService.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. Non è possibile garantire l'ordine con cui questi servizi del motore di runtime del flusso di lavoro vengono arrestati e alcuni di questi servizi possono dover mantenere alcune funzionalità da cui dipendono altri servizi fino a quando anche questi altri servizi verranno arrestati.There is no guarantee about the order in which these workflow run-time 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. Tali servizi possono eseguire l'override del metodo WorkflowRuntimeService.OnStopped per eseguire l'eventuale logica di arresto rimanente quando viene generato l'evento Stopped.Such services can override the WorkflowRuntimeService.OnStopped method to perform any residual shutdown logic when the Stopped event is raised.

Per ulteriori informazioni sulla gestione degli eventi, vedere gestione e generazione di eventi.For more information about handling events, see Handling and raising events.

Applies to