C# 클래스 Hiro.ContainerCompiler

A class that compile a dependency graph into an inversion of control container.
상속: IContainerCompiler
파일 보기 프로젝트 열기: philiplaureano/Hiro 1 사용 예제들

공개 메소드들

메소드 설명
Compile ( string typeName, string namespaceName, string assemblyName, IDependencyContainer dependencyContainer ) : AssemblyDefinition

Compiles a dependency graph into an IOC container.

ContainerCompiler ( ) : System

Initializes a new instance of the ContainerCompiler class.

ContainerCompiler ( IGetInstanceMethodImplementor getInstanceMethodImplementor, IContainsMethodImplementor containsMethodImplementor, ICreateContainerType createContainerType, IServiceMapBuilder serviceMapBuilder, IGetAllInstancesMethodImplementor getAllInstancesMethodImplementor ) : System

Initializes a new instance of the ContainerCompiler class.

비공개 메소드들

메소드 설명
AddInitializationMap ( Mono.Cecil.TypeDefinition containerType, Mono.Cecil.ModuleDefinition module, FieldBuilder fieldEmitter ) : void

Modifies the default constructor to initialize the "__initializedServices" field so that it can ensure that all services called with the IInitialize.Initialize are initialized once per object lifetime.

AddJumpEntries ( Mono.Cecil.ModuleDefinition module, FieldDefinition jumpTargetField, Mono.Cecil.TypeDefinition targetType, MethodReference getServiceHash, IImplementation>.IDictionary serviceMap, int>.IDictionary jumpTargets ) : void

Modifies the default constructor of a container type so that the jump labels used in the IMicroContainer.GetInstance implementation will be precalculated every time the compiled container is instantiated.

InitializeContainerPlugins ( Mono.Cecil.ModuleDefinition module, IDependencyContainer dependencyContainer, Mono.Cecil.Cil.ILProcessor il ) : void

Emits the instructions that introduce the IContainerPlugin instances to the current IMicroContainer instance.

RemoveLastInstruction ( Mono body ) : void

Removes the last instruction from the given method body.

메소드 상세

Compile() 공개 메소드

Compiles a dependency graph into an IOC container.
public Compile ( string typeName, string namespaceName, string assemblyName, IDependencyContainer dependencyContainer ) : AssemblyDefinition
typeName string The name of the type.
namespaceName string The namespace name that will be associated with the container type.
assemblyName string The name of the assembly that will contain the container type.
dependencyContainer IDependencyContainer The instance that contains the services that will be instantiated by compiled container.
리턴 Mono.Cecil.AssemblyDefinition

ContainerCompiler() 공개 메소드

Initializes a new instance of the ContainerCompiler class.
public ContainerCompiler ( ) : System
리턴 System

ContainerCompiler() 공개 메소드

Initializes a new instance of the ContainerCompiler class.
public ContainerCompiler ( IGetInstanceMethodImplementor getInstanceMethodImplementor, IContainsMethodImplementor containsMethodImplementor, ICreateContainerType createContainerType, IServiceMapBuilder serviceMapBuilder, IGetAllInstancesMethodImplementor getAllInstancesMethodImplementor ) : System
getInstanceMethodImplementor IGetInstanceMethodImplementor The class that will implement the GetInstance method.
containsMethodImplementor IContainsMethodImplementor The class that will implement the Contains method.
createContainerType ICreateContainerType The class that will define the container type.
serviceMapBuilder IServiceMapBuilder The class that will define the service map.
getAllInstancesMethodImplementor IGetAllInstancesMethodImplementor The class that will implement the GetAllInstances method.
리턴 System