Editar

Compartir a través de


MixedRealityServiceRegistry.TryGetService Method

Definition

Overloads

TryGetService(Type, IMixedRealityService, IMixedRealityServiceRegistrar, String)

Gets the first instance of the requested service from the registry that matches the given query.

TryGetService<T>(T, String)

Gets the first instance of the requested service from the registry that matches the given query.

TryGetService<T>(T, IMixedRealityServiceRegistrar, String)

Gets the first instance of the requested service from the registry that matches the given query.

TryGetService(Type, IMixedRealityService, IMixedRealityServiceRegistrar, String)

Gets the first instance of the requested service from the registry that matches the given query.

public static bool TryGetService (Type interfaceType, out Microsoft.MixedReality.Toolkit.IMixedRealityService serviceInstance, out Microsoft.MixedReality.Toolkit.IMixedRealityServiceRegistrar registrar, string name = default);
static member TryGetService : Type * IMixedRealityService * IMixedRealityServiceRegistrar * string -> bool
Public Shared Function TryGetService (interfaceType As Type, ByRef serviceInstance As IMixedRealityService, ByRef registrar As IMixedRealityServiceRegistrar, Optional name As String = Nothing) As Boolean

Parameters

interfaceType
Type

The interface type of the service being requested.

serviceInstance
IMixedRealityService

Output parameter to receive the requested service instance.

registrar
IMixedRealityServiceRegistrar

Output parameter to receive the registrar that loaded the service instance.

name
String

Optional name of the service.

Returns

True if the requested service is being returned, false otherwise.

Applies to

TryGetService<T>(T, String)

Gets the first instance of the requested service from the registry that matches the given query.

public static bool TryGetService<T> (out T serviceInstance, string name = default) where T : Microsoft.MixedReality.Toolkit.IMixedRealityService;
static member TryGetService : 'T * string -> bool (requires 'T :> Microsoft.MixedReality.Toolkit.IMixedRealityService)
Public Shared Function TryGetService(Of T As IMixedRealityService) (ByRef serviceInstance As T, Optional name As String = Nothing) As Boolean

Type Parameters

T

The interface type of the service being requested.

Parameters

serviceInstance
T

Output parameter to receive the requested service instance.

name
String

Optional name of the service.

Returns

True if the requested service is being returned, false otherwise.

Applies to

TryGetService<T>(T, IMixedRealityServiceRegistrar, String)

Gets the first instance of the requested service from the registry that matches the given query.

public static bool TryGetService<T> (out T serviceInstance, out Microsoft.MixedReality.Toolkit.IMixedRealityServiceRegistrar registrar, string name = default) where T : Microsoft.MixedReality.Toolkit.IMixedRealityService;
static member TryGetService : 'T * IMixedRealityServiceRegistrar * string -> bool (requires 'T :> Microsoft.MixedReality.Toolkit.IMixedRealityService)
Public Shared Function TryGetService(Of T As IMixedRealityService) (ByRef serviceInstance As T, ByRef registrar As IMixedRealityServiceRegistrar, Optional name As String = Nothing) As Boolean

Type Parameters

T

The interface type of the service being requested.

Parameters

serviceInstance
T

Output parameter to receive the requested service instance.

registrar
IMixedRealityServiceRegistrar

Output parameter to receive the registrar that loaded the service instance.

name
String

Optional name of the service.

Returns

True if the requested service is being returned, false otherwise.

Applies to