C# Class Hiro.InstanceContainer

Represents a IMicroContainer type that can store object references.
Inheritance: IMicroContainer
Show file Open project: philiplaureano/Hiro

Public Methods

Method Description
Contains ( System serviceType, string key ) : bool

Determines whether or not the container holds a particular service implementation.

GetAllInstances ( System serviceType ) : IEnumerable

Returns all object instances that match the given serviceType.

GetInstance ( System serviceType, string key ) : object

Obtains an object instance that matches the given serviceType and service name.

InstanceContainer ( System serviceType, string serviceName, object instance ) : System

Initializes a new instance of the InstanceContainer class.

Method Details

Contains() public method

Determines whether or not the container holds a particular service implementation.
public Contains ( System serviceType, string key ) : bool
serviceType System The service type to be instantiated.
key string The name of the service itself.
return bool

GetAllInstances() public method

Returns all object instances that match the given serviceType.
public GetAllInstances ( System serviceType ) : IEnumerable
serviceType System The service type to be instantiated.
return IEnumerable

GetInstance() public method

Obtains an object instance that matches the given serviceType and service name.
public GetInstance ( System serviceType, string key ) : object
serviceType System The service type to be instantiated.
key string The name of the service itself.
return object

InstanceContainer() public method

Initializes a new instance of the InstanceContainer class.
public InstanceContainer ( System serviceType, string serviceName, object instance ) : System
serviceType System The service type.
serviceName string The service name.
instance object The instance that the container will contain.
return System