WorkflowRuntime.GetAllServices Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
GetAllServices(Type) |
Retrieves all the services that are added to the workflow run-time engine that implement or derive from the specified Type. |
GetAllServices<T>() |
Retrieves all the services that are added to the workflow run-time engine that implement or derive from the specified generic type. |
GetAllServices(Type)
Retrieves all the services that are added to the workflow run-time engine that implement or derive from the specified Type.
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)
Parameters
Returns
Services that implement or derive from the specified Type.
Exceptions
serviceType
is a null reference (Nothing
in Visual Basic).
The WorkflowRuntime is disposed.
Examples
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<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)
Remarks
An empty ReadOnlyCollection<T> indicates that no services that implement or derive from the specified Type have been added to the workflow run-time engine.
Applies to
GetAllServices<T>()
Retrieves all the services that are added to the workflow run-time engine that implement or derive from the specified generic type.
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)
Type Parameters
- T
The service type.
Returns
Services that implement or derive from the specified generic type.
Exceptions
The WorkflowRuntime is disposed.
Examples
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>();
' 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)()
Remarks
An empty ReadOnlyCollection<T> indicates that no services have been added to the workflow run-time engine that implement or derive from the specified generic type.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기