C# 클래스 LinFu.IoC.ServiceContainer

Represents a service container with additional extension points for customizing service instances
상속: IServiceContainer
파일 보기 프로젝트 열기: philiplaureano/LinFu 1 사용 예제들

Private Properties

프로퍼티 타입 설명

공개 메소드들

메소드 설명
AddFactory ( Type serviceType, IEnumerable additionalParameterTypes, IFactory factory ) : void

Adds an IFactory instance and associates it with the given service type.

AddFactory ( string serviceName, Type serviceType, IEnumerable additionalParameterTypes, IFactory factory ) : void

Adds an IFactory instance and associates it with the given service type and service name.

Contains ( Type serviceType, IEnumerable additionalParameterTypes ) : bool

Determines whether or not the given serviceType can be instantiated by the container.

Contains ( string serviceName, Type serviceType, IEnumerable additionalParameterTypes ) : bool

Determines whether or not a service can be created using the given service name and service type.

GetService ( Type serviceType ) : object

Overridden. Causes the container to instantiate the service with the given service type. If the service type cannot be created, then an exception will be thrown if the IContainer.SuppressErrors property is set to false. Otherwise, it will simply return null.

This overload of the GetService method has been overridden so that its results can be handled by the postprocessors.

GetService ( string serviceName, Type serviceType ) : object

Causes the container to instantiate the service with the given service type. If the service type cannot be created, then an exception will be thrown if the IContainer.SuppressErrors property is set to false. Otherwise, it will simply return null.

ServiceContainer ( ) : System

Initializes the container with the default services.

ServiceContainer ( IGetService getServiceBehavior, IFactoryStorage factoryStorage ) : System

Initializes the container with a custom ICreateInstance type.

메소드 상세

AddFactory() 공개 메소드

Adds an IFactory instance and associates it with the given service type.
public AddFactory ( Type serviceType, IEnumerable additionalParameterTypes, IFactory factory ) : void
serviceType System.Type The service type to associate with the factory
additionalParameterTypes IEnumerable The list of additional parameters that this factory type will support.
factory IFactory The instance that will be responsible for creating the service instance
리턴 void

AddFactory() 공개 메소드

Adds an IFactory instance and associates it with the given service type and service name.
public AddFactory ( string serviceName, Type serviceType, IEnumerable additionalParameterTypes, IFactory factory ) : void
serviceName string The name of the service to associate with the given instance.
serviceType System.Type The type of service that the factory will be able to create.
additionalParameterTypes IEnumerable The list of additional parameters that this factory type will support.
factory IFactory The instance that will create the object instance.
리턴 void

Contains() 공개 메소드

Determines whether or not the given serviceType can be instantiated by the container.
public Contains ( Type serviceType, IEnumerable additionalParameterTypes ) : bool
serviceType System.Type The type of service to instantiate.
additionalParameterTypes IEnumerable The list of additional parameters that this factory type will support.
리턴 bool

Contains() 공개 메소드

Determines whether or not a service can be created using the given service name and service type.
public Contains ( string serviceName, Type serviceType, IEnumerable additionalParameterTypes ) : bool
serviceName string The name of the service to associate with the given instance.
serviceType System.Type The type of service that the factory will be able to create.
additionalParameterTypes IEnumerable The list of additional parameters that this factory type will support.
리턴 bool

GetService() 공개 메소드

Overridden. Causes the container to instantiate the service with the given service type. If the service type cannot be created, then an exception will be thrown if the IContainer.SuppressErrors property is set to false. Otherwise, it will simply return null.
This overload of the GetService method has been overridden so that its results can be handled by the postprocessors.
public GetService ( Type serviceType ) : object
serviceType System.Type The service type to instantiate.
리턴 object

GetService() 공개 메소드

Causes the container to instantiate the service with the given service type. If the service type cannot be created, then an exception will be thrown if the IContainer.SuppressErrors property is set to false. Otherwise, it will simply return null.
public GetService ( string serviceName, Type serviceType ) : object
serviceName string The name of the service to instantiate.
serviceType System.Type The service type to instantiate.
리턴 object

ServiceContainer() 공개 메소드

Initializes the container with the default services.
public ServiceContainer ( ) : System
리턴 System

ServiceContainer() 공개 메소드

Initializes the container with a custom ICreateInstance type.
public ServiceContainer ( IGetService getServiceBehavior, IFactoryStorage factoryStorage ) : System
getServiceBehavior IGetService The instance that will be responsible for generating service instances.
factoryStorage IFactoryStorage The instance responsible for determining which factory instance will instantiate a given service request.
리턴 System