This documentation is archived and is not being maintained.

WorkflowRuntime.GetAllServices Generic Method ()

Retrieves all the services that have been added to the workflow runtime engine that implement or derive from the specified generic type.

Namespace: System.Workflow.Runtime
Assembly: System.Workflow.Runtime (in system.workflow.runtime.dll)

public ReadOnlyCollection<T> GetAllServices<T> ()
J# supports the use of generic types and methods, but not the declaration of new ones.
JScript does not support generic types and methods.
Not applicable.

Return Value

A ReadOnlyCollection that contains objects that represent services that implement or derive from the specified generic type.

Exception typeCondition

ObjectDisposedException

The WorkflowRuntime is disposed.

An empty ReadOnlyCollection indicates that no services have been added to the workflow runtime engine that implement or derive from the specified generic type.

The following example demonstrates how to retrieve all services of a given type from a WorkflowRuntime object.

// Create a new workflow runtime
WorkflowRuntime workflowRuntime = new WorkflowRuntime();
// Obtain the type of the TrackingService abstract class
Type serviceType = typeof(TrackingService);
// Create a services collection
ReadOnlyCollection<TrackingService> services;
// Fetch a collection of all services that match the given type
services = workflowRuntime.GetAllServices<TrackingService>();

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Show: