C# Class Hiro.GenericInstanceContainer

Represents a container type that instantiates generic types at runtime.
Inheritance: IMicroContainer
Afficher le fichier Open project: philiplaureano/Hiro Class Usage Examples

Méthodes publiques

Méthode Description
Contains ( Type serviceType, string key ) : bool

Determines whether or not the container can instantiate the given serviceType.

GenericInstanceContainer ( string serviceName, Type genericServiceType, Type genericTypeImplementation, IDependencyContainer dependencyContainer ) : System

Initializes a new instance of the GenericInstanceContainer class.

GetAllInstances ( Type serviceType ) : IEnumerable

Returns all generic instances that match the given serviceType.

GetInstance ( Type serviceType, string key ) : object

Attempts to get an instance of the given serviceType.

Méthodes protégées

Méthode Description
Register ( Type serviceType, Type concreteType, DependencyMap map ) : void

Registers the generic service type.

Private Methods

Méthode Description
BuildBaseContainer ( ) : void

Method Details

Contains() public méthode

Determines whether or not the container can instantiate the given serviceType.
public Contains ( Type serviceType, string key ) : bool
serviceType System.Type The service type.
key string The name of the service
Résultat bool

GenericInstanceContainer() public méthode

Initializes a new instance of the GenericInstanceContainer class.
public GenericInstanceContainer ( string serviceName, Type genericServiceType, Type genericTypeImplementation, IDependencyContainer dependencyContainer ) : System
serviceName string The name of the generic service.
genericServiceType System.Type The generic type that represents the service type.
genericTypeImplementation System.Type The type that represents the generic service type implementation.
dependencyContainer IDependencyContainer The dependency map that describes the list of services that will be available to the instantiated generic types.
Résultat System

GetAllInstances() public méthode

Returns all generic instances that match the given serviceType.
public GetAllInstances ( Type serviceType ) : IEnumerable
serviceType System.Type The service type.
Résultat IEnumerable

GetInstance() public méthode

Attempts to get an instance of the given serviceType.
public GetInstance ( Type serviceType, string key ) : object
serviceType System.Type The service type.
key string The service name.
Résultat object

Register() protected méthode

Registers the generic service type.
protected Register ( Type serviceType, Type concreteType, DependencyMap map ) : void
serviceType System.Type The service type that will be registered.
concreteType System.Type The generic concrete type that will implement the generic service type.
map DependencyMap The dependency map that contains all the dependencies.
Résultat void