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.

C#
public static bool TryGetService (Type interfaceType, out Microsoft.MixedReality.Toolkit.IMixedRealityService serviceInstance, out Microsoft.MixedReality.Toolkit.IMixedRealityServiceRegistrar registrar, string name = default);

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

MRTK2 Unity 2018 2.7.0 ve diğer sürümler
Ürün Sürümler
MRTK2 Unity 2018 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0
MRTK2 Unity 2019 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0
MRTK2 Unity 2020 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0

TryGetService<T>(T, String)

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

C#
public static bool TryGetService<T> (out T serviceInstance, string name = default) where T : Microsoft.MixedReality.Toolkit.IMixedRealityService;

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

MRTK2 Unity 2018 2.7.0 ve diğer sürümler
Ürün Sürümler
MRTK2 Unity 2018 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0
MRTK2 Unity 2019 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0
MRTK2 Unity 2020 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0

TryGetService<T>(T, IMixedRealityServiceRegistrar, String)

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

C#
public static bool TryGetService<T> (out T serviceInstance, out Microsoft.MixedReality.Toolkit.IMixedRealityServiceRegistrar registrar, string name = default) where T : Microsoft.MixedReality.Toolkit.IMixedRealityService;

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

MRTK2 Unity 2018 2.7.0 ve diğer sürümler
Ürün Sürümler
MRTK2 Unity 2018 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0
MRTK2 Unity 2019 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0
MRTK2 Unity 2020 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0