WorkflowRuntime.RemoveService(Object) Yöntem

Tanım

Belirtilen hizmeti iş akışı çalışma zamanı altyapısından kaldırır.

public:
 void RemoveService(System::Object ^ service);
public void RemoveService (object service);
member this.RemoveService : obj -> unit
Public Sub RemoveService (service As Object)

Parametreler

service
Object

Kaldırılacak hizmeti temsil eden bir nesne.

Özel durumlar

service bir null başvurudur (Nothing Visual Basic'te).

İş akışı çalışma zamanı altyapısı başlatılmıştır (IsStarted ) trueve service temel bir hizmettir.

-veya-

service iş akışı çalışma zamanı altyapısına kaydedilmedi.

Örnekler

Aşağıdaki örnekte, öğesi SqlWorkflowPersistenceService eklenir ve öğesinden WorkflowRuntimekaldırılır.

// Create a new workflow runtime
WorkflowRuntime workflowRuntime = new WorkflowRuntime();
// Create a new instance of the out-of-box SqlWorkflowPersistenceService
SqlWorkflowPersistenceService persistenceService =
   new SqlWorkflowPersistenceService(
   "Initial Catalog=SqlPersistenceService;Data Source=localhost;Integrated Security=SSPI;");
// Add the service to the runtime
workflowRuntime.AddService(persistenceService);
// Start the runtime
workflowRuntime.StartRuntime();
// Stop the runtime
workflowRuntime.StopRuntime();
// Remove the service from the runtime
workflowRuntime.RemoveService(persistenceService);
' Create a new workflow runtime
Dim workflowRuntime As New WorkflowRuntime()
' Create a new instance of the out-of-box SqlWorkflowPersistenceService
Dim persistenceService As New SqlWorkflowPersistenceService( _
   "Initial Catalog=SqlPersistenceServiceData Source=localhostIntegrated Security=SSPI")
' Add the service to the runtime
workflowRuntime.AddService(persistenceService)
' Start the runtime
workflowRuntime.StartRuntime()
' Stop the runtime
workflowRuntime.StopRuntime()
' Remove the service from the runtime
workflowRuntime.RemoveService(persistenceService)

Açıklamalar

İş akışı çalışma zamanı altyapısı çalışırken çekirdek hizmeti kaldıramazsınız (IsStarted olur true). Temel hizmetler sınıfından, sınıfından WorkflowSchedulerService , sınıfından WorkflowCommitWorkBatchService veya sınıfından WorkflowPersistenceService türetilen hizmetlerdir TrackingService . sınıfından türetilirseservice, RemoveService tarafından serviceuygulanan yöntemini çağırırStop.WorkflowRuntimeService

Şunlara uygulanır