Sdílet prostřednictvím


WorkflowRuntime.GetAllServices Metoda

Definice

Přetížení

GetAllServices(Type)

Načte všechny služby přidané do modulu běhu pracovního postupu, který implementuje nebo odvozuje ze zadaného Typemodulu .

GetAllServices<T>()

Načte všechny služby přidané do modulu běhu pracovního postupu, který implementuje nebo odvozuje ze zadaného obecného typu.

GetAllServices(Type)

Načte všechny služby přidané do modulu běhu pracovního postupu, který implementuje nebo odvozuje ze zadaného Typemodulu .

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)

Parametry

serviceType
Type

Tyto Type služby musí být implementovány, aby se vrátily.

Návraty

ReadOnlyCollection<Object>

Služby, které implementují nebo odvozují od zadaného Type.

Výjimky

serviceTypeje nulový odkaz (Nothingv Visual Basic).

Příklady

Následující příklad ukazuje, jak načíst všechny služby daného typu z objektu 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)

Poznámky

Prázdný ReadOnlyCollection<T> označuje, že do modulu běhu pracovního postupu nebyly přidány žádné služby, které implementují nebo odvozují ze zadaného Type modulu.

Platí pro

GetAllServices<T>()

Načte všechny služby přidané do modulu běhu pracovního postupu, který implementuje nebo odvozuje ze zadaného obecného typu.

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)

Parametry typu

T

Typ služby.

Návraty

ReadOnlyCollection<T>

Služby, které implementují nebo odvozují ze zadaného obecného typu.

Výjimky

Příklady

Následující příklad ukazuje, jak načíst všechny služby daného typu z objektu 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)()

Poznámky

Prázdný ReadOnlyCollection<T> označuje, že do modulu běhu pracovního postupu, který implementuje nebo odvozuje ze zadaného obecného typu, nebyly přidány žádné služby.

Platí pro