Show / Hide Table of Contents

Interface IReadOnlyServiceLocator

The read only interfaces for the IServiceLocator pattern. Should be used if you would only like to retrieve services, without giving and ability to register new ones.

Namespace: StansAssets.Foundation.Patterns
Assembly: cs.temp.dll.dll
Syntax
public interface IReadOnlyServiceLocator

Methods

Get(Type)

Gets the service instance of the given type.

Declaration
object Get(Type type)
Parameters
Type Name Description
System.Type type

The type of the service to lookup.

Returns
Type Description
System.Object

The service instance.

Get<T>()

Gets the service instance of the given type.

Declaration
T Get<T>()
Returns
Type Description
T

The service instance.

Type Parameters
Name Description
T

The type of the service to lookup.

IsRegistered(Type)

Check if service is registered for a given type.

Declaration
bool IsRegistered(Type type)
Parameters
Type Name Description
System.Type type

The type of the service to lookup.

Returns
Type Description
System.Boolean

Returns true if service is registered and false otherwise.

IsRegistered<T>()

Check if service is registered for a given type.

Declaration
bool IsRegistered<T>()
Returns
Type Description
System.Boolean

Returns true if service is registered and false otherwise.

Type Parameters
Name Description
T

The type of the service to lookup.

In This Article
Back to top Generated by DocFX