WorkflowRuntime.GetAllServices Método

Definición

Sobrecargas

GetAllServices(Type)

Recupera todos los servicios agregados al motor en tiempo de ejecución de flujo de trabajo que implementa o deriva de un Type especificado.

GetAllServices<T>()

Recupera todos los servicios agregados al motor en tiempo de ejecución de flujo de trabajo que implementa o deriva del tipo genérico especificado.

GetAllServices(Type)

Recupera todos los servicios agregados al motor en tiempo de ejecución de flujo de trabajo que implementa o deriva de un Type especificado.

public:
 System::Collections::ObjectModel::ReadOnlyCollection<System::Object ^> ^ GetAllServices(Type ^ serviceType);
public System.Collections.ObjectModel.ReadOnlyCollection<object> GetAllServices (Type serviceType);
member this.GetAllServices : Type -> System.Collections.ObjectModel.ReadOnlyCollection<obj>
Public Function GetAllServices (serviceType As Type) As ReadOnlyCollection(Of Object)

Parámetros

serviceType
Type

Type que los servicios deben implementar para que se devuelva.

Devoluciones

ReadOnlyCollection<Object>

Servicios que implementan o derivan del Type especificado.

Excepciones

serviceType es una referencia nula (Nothing en Visual Basic).

Ejemplos

En el siguiente ejemplo de código se muestra cómo recuperar todos los servicios de un tipo determinado desde el objeto WorkflowRuntime.

// 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<object> services;
// Fetch a collection of all services that match the given type
services = workflowRuntime.GetAllServices(serviceType);
' Create a new workflow runtime
Dim workflowRuntime As New WorkflowRuntime()
' Obtain the type of the TrackingService abstract class
Dim serviceType As Type = GetType(TrackingService)
' Create a services collection
Dim services As ReadOnlyCollection(Of Object)
' Fetch a collection of all services that match the given type
services = workflowRuntime.GetAllServices(serviceType)

Comentarios

Un ReadOnlyCollection<T> vacío indica que ningún servicio que implemente o derive del Type especificado se ha agregado al motor en tiempo de ejecución de flujo de trabajo.

Se aplica a

GetAllServices<T>()

Recupera todos los servicios agregados al motor en tiempo de ejecución de flujo de trabajo que implementa o deriva del tipo genérico especificado.

public:
generic <typename T>
 System::Collections::ObjectModel::ReadOnlyCollection<T> ^ GetAllServices();
public System.Collections.ObjectModel.ReadOnlyCollection<T> GetAllServices<T> ();
member this.GetAllServices : unit -> System.Collections.ObjectModel.ReadOnlyCollection<'T>
Public Function GetAllServices(Of T) () As ReadOnlyCollection(Of T)

Parámetros de tipo

T

El tipo de servicio.

Devoluciones

ReadOnlyCollection<T>

Servicios que implementan o derivan del tipo genérico especificado.

Excepciones

Ejemplos

En el siguiente ejemplo de código se muestra cómo recuperar todos los servicios de un tipo determinado desde el objeto WorkflowRuntime.

// 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>();
' Create a new workflow runtime
Dim workflowRuntime As New WorkflowRuntime()
' Obtain the type of the TrackingService abstract class
Dim serviceType As Type = GetType(TrackingService)
' Create a services collection
Dim services As ReadOnlyCollection(Of TrackingService)
' Fetch a collection of all services that match the given type
services = workflowRuntime.GetAllServices(Of TrackingService)()

Comentarios

Un ReadOnlyCollection<T> vacío indica que no se agregó ningún servicio al motor en tiempo de ejecución de flujo de trabajo que implementa o deriva del tipo genérico especificado.

Se aplica a