Table of Contents

Class ServiceRegistryExtensions

Namespace
Stride.Core
Assembly
Stride.Core.dll
public static class ServiceRegistryExtensions
Inheritance
ServiceRegistryExtensions

Methods

GetSafeServiceAs<T>(IServiceRegistry)

Gets a service instance from a specified interface contract.

public static T GetSafeServiceAs<T>(this IServiceRegistry registry) where T : class

Parameters

registry IServiceRegistry

The registry.

Returns

T

An instance of the requested service registered to this registry.

Type Parameters

T

Type of the interface contract of the service

Exceptions

ServiceNotFoundException

If the service was not found

GetServiceLate<T>(IServiceRegistry, Action<T>)

Gets a service instance from a specified interface contract.

public static void GetServiceLate<T>(this IServiceRegistry registry, Action<T> serviceReady) where T : class

Parameters

registry IServiceRegistry

The registry.

serviceReady Action<T>

The service ready.

Type Parameters

T

Type of the interface contract of the service

Exceptions

ServiceNotFoundException

If the service was not found