Share via


WorkflowRuntime.Stopped Kejadian

Definisi

Terjadi ketika mesin run-time alur kerja dihentikan.

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) 

Jenis Acara

Contoh

Dalam contoh berikut, penanganan aktivitas ditambahkan ke Stopped peristiwa WorkflowRuntime. Dalam contoh ini, handler adalah metode anonim yang mencetak pesan sederhana ke konsol.

// 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

Keterangan

Metode ini StopRuntime meningkatkan Stopped peristiwa setelah memanggil metode yang Stop diterapkan oleh masing-masing layanannya yang berasal dari WorkflowRuntimeService kelas . Tidak ada jaminan tentang urutan di mana layanan mesin run-time alur kerja ini dihentikan, dan beberapa layanan ini mungkin perlu mempertahankan beberapa fungsionalitas yang diandalkan oleh layanan lain sampai juga dihentikan. Layanan tersebut WorkflowRuntimeService.OnStopped dapat mengambil alih metode untuk melakukan logika pematian residu saat Stopped peristiwa dinaikkan.

Untuk informasi selengkapnya tentang menangani peristiwa, lihat Menangani dan menaikkan peristiwa.

Berlaku untuk