C# Class LinFu.Proxy.MethodBodyEmitter

Inheritance: IMethodBodyEmitter, IInitialize
Exibir arquivo Open project: philiplaureano/LinFu Class Usage Examples

Public Methods

Method Description
Emit ( MethodInfo originalMethod, Mono.Cecil.MethodDefinition targetMethod ) : void

Generates a method body for the targetMethod.

Initialize ( IServiceContainer source ) : void

Initializes the MethodBodyEmitter class.

MethodBodyEmitter ( ) : System

Initializes the class with the default values.

Protected Methods

Method Description
EmitGetInterceptorInstruction ( Mono.Cecil.Cil.CilWorker IL, TypeReference proxyType, MethodReference getInterceptorMethod ) : void

Emits the IL instructions to obtain an IInterceptor instance for the proxy type.

ImplementNotFound ( Mono.Cecil.Cil.CilWorker IL ) : void

Causes the CilWorker to make the method throw a NotImplementedException if the method cannot be found.

Private Methods

Method Description
SaveRefArguments ( Mono.Cecil.Cil.CilWorker IL, IEnumerable parameters, Mono.Cecil.Cil.VariableDefinition invocationInfo, Mono.Cecil.Cil.VariableDefinition arguments ) : void

Saves the ref arguments of a given method using the arguments from the invocationInfo object.

Method Details

Emit() public method

Generates a method body for the targetMethod.
public Emit ( MethodInfo originalMethod, Mono.Cecil.MethodDefinition targetMethod ) : void
originalMethod System.Reflection.MethodInfo The method currently being intercepted.
targetMethod Mono.Cecil.MethodDefinition The target method that will contain the new method body.
return void

EmitGetInterceptorInstruction() protected method

Emits the IL instructions to obtain an IInterceptor instance for the proxy type.
protected EmitGetInterceptorInstruction ( Mono.Cecil.Cil.CilWorker IL, TypeReference proxyType, MethodReference getInterceptorMethod ) : void
IL Mono.Cecil.Cil.CilWorker The responsible for emitting the method body.
proxyType Mono.Cecil.TypeReference The proxy type.
getInterceptorMethod Mono.Cecil.MethodReference The getter method for the interceptor.
return void

ImplementNotFound() protected method

Causes the CilWorker to make the method throw a NotImplementedException if the method cannot be found.
protected ImplementNotFound ( Mono.Cecil.Cil.CilWorker IL ) : void
IL Mono.Cecil.Cil.CilWorker The responsible for emitting the method body.
return void

Initialize() public method

Initializes the MethodBodyEmitter class.
public Initialize ( IServiceContainer source ) : void
source IServiceContainer
return void

MethodBodyEmitter() public method

Initializes the class with the default values.
public MethodBodyEmitter ( ) : System
return System