C# 클래스 Hiro.Compilers.SingletonEmitter

Represents the basic implementation of a ISingletonEmitter instance.
상속: ISingletonEmitter
파일 보기 프로젝트 열기: philiplaureano/Hiro

공개 메소드들

메소드 설명
EmitService ( Mono.Cecil.MethodDefinition targetMethod, IDependency dependency, IImplementation implementation, IImplementation>.IDictionary serviceMap ) : void

Emits a service as a singleton type.

보호된 메소드들

메소드 설명
EmitSingletonInstantiation ( IDependency dependency, IImplementation implementation, IImplementation>.IDictionary serviceMap, FieldDefinition instanceField, Mono.Cecil.MethodDefinition cctor, Mono.Cecil.ModuleDefinition module, Mono.Cecil.MethodDefinition targetMethod ) : void

Defines the instructions that will instantiate the singleton instance itself.

비공개 메소드들

메소드 설명
AddDefaultSingletonConstructor ( Mono.Cecil.ModuleDefinition module, string singletonName, TypeAttributes typeAttributes, TypeReference objectType ) : Mono.Cecil.TypeDefinition

Adds a default constructor to the singleton type.

DefineGetInstance ( Mono.Cecil.TypeDefinition singletonType, Mono.Cecil.Cil.ILProcessor il, FieldDefinition instanceField ) : Mono.Cecil.MethodDefinition

Defines the factory method on the singleton type.

DefineNestedConstructors ( Mono.Cecil.ModuleDefinition module, Mono.Cecil.TypeDefinition nestedType ) : Mono.Cecil.MethodDefinition

Defines the nested constructors for the singleton type.

DefineNestedType ( Mono.Cecil.ModuleDefinition module, Mono.Cecil.TypeDefinition singletonType, FieldDefinition instanceField, IImplementation>.IDictionary serviceMap, IImplementation implementation, IDependency dependency, Mono.Cecil.MethodDefinition targetMethod ) : void

Defines the nested type that will instantiate the actual singleton service instance.

DefineStaticConstructor ( Mono.Cecil.ModuleDefinition module, Mono.Cecil.TypeDefinition nestedType ) : Mono.Cecil.MethodDefinition

Defines the static constructor for the nested type.

메소드 상세

EmitService() 공개 메소드

Emits a service as a singleton type.
public EmitService ( Mono.Cecil.MethodDefinition targetMethod, IDependency dependency, IImplementation implementation, IImplementation>.IDictionary serviceMap ) : void
targetMethod Mono.Cecil.MethodDefinition The method implementation.
dependency IDependency The dependency that will be instantiated by the container.
implementation IImplementation The implementation that will be used to instantiate the dependency.
serviceMap IImplementation>.IDictionary The service map the contains the current application dependencies.
리턴 void

EmitSingletonInstantiation() 보호된 메소드

Defines the instructions that will instantiate the singleton instance itself.
protected EmitSingletonInstantiation ( IDependency dependency, IImplementation implementation, IImplementation>.IDictionary serviceMap, FieldDefinition instanceField, Mono.Cecil.MethodDefinition cctor, Mono.Cecil.ModuleDefinition module, Mono.Cecil.MethodDefinition targetMethod ) : void
dependency IDependency The dependency that will be instantiated by the singleton.
implementation IImplementation The implementation that will instantiate the dependency.
serviceMap IImplementation>.IDictionary The service map that contains the list of dependencies in the application.
instanceField Mono.Cecil.FieldDefinition The field that will hold the singleton instance.
cctor Mono.Cecil.MethodDefinition The static constructor itself.
module Mono.Cecil.ModuleDefinition The target module.
targetMethod Mono.Cecil.MethodDefinition The target method that will instantiate the service instance.
리턴 void