C# Class LinFu.AOP.Cecil.InterceptAndSurroundMethodBody

Represents a method body rewriter that surrounds a method body with the necessary prolog and epilogs that enable method body interception.
Inheritance: IMethodBodyRewriter
Mostra file Open project: philiplaureano/LinFu Class Usage Examples

Public Methods

Method Description
InterceptAndSurroundMethodBody ( IEmitInvocationInfo emitter, IInstructionEmitter getInterceptionDisabled, ISurroundMethodBody surroundMethodBody, IInstructionEmitter getInstanceMethodReplacementProvider, IInstructionEmitter getClassMethodReplacementProvider, IInstructionEmitter addMethodReplacement, IMethodBodyRewriterParameters parameters ) : System.Collections.Generic

Initializes a new instance of the InterceptAndSurroundMethodBody class.

Rewrite ( Mono.Cecil.MethodDefinition method, Mono.Cecil.Cil.CilWorker IL, IEnumerable oldInstructions ) : void

Rewrites a target method using the given CilWorker.

Method Details

InterceptAndSurroundMethodBody() public method

Initializes a new instance of the InterceptAndSurroundMethodBody class.
public InterceptAndSurroundMethodBody ( IEmitInvocationInfo emitter, IInstructionEmitter getInterceptionDisabled, ISurroundMethodBody surroundMethodBody, IInstructionEmitter getInstanceMethodReplacementProvider, IInstructionEmitter getClassMethodReplacementProvider, IInstructionEmitter addMethodReplacement, IMethodBodyRewriterParameters parameters ) : System.Collections.Generic
emitter IEmitInvocationInfo The emitter that will instantiate the instance.
getInterceptionDisabled IInstructionEmitter The emitter that will determine whether or not method interception is enabled.
surroundMethodBody ISurroundMethodBody The instance that will add the epilogs and prologs to the method body.
getInstanceMethodReplacementProvider IInstructionEmitter The emitter that will obtain the method replacement provider instance.
getClassMethodReplacementProvider IInstructionEmitter The emitter that will obtain the class-level method replacement provider instance.
addMethodReplacement IInstructionEmitter The instruction emitter that will add the call to obtain the method body replacement instance.
parameters IMethodBodyRewriterParameters The parameters that describe the context of the method body rewrite.
return System.Collections.Generic

Rewrite() public method

Rewrites a target method using the given CilWorker.
public Rewrite ( Mono.Cecil.MethodDefinition method, Mono.Cecil.Cil.CilWorker IL, IEnumerable oldInstructions ) : void
method Mono.Cecil.MethodDefinition The target method.
IL Mono.Cecil.Cil.CilWorker The CilWorker that will be used to rewrite the target method.
oldInstructions IEnumerable The original instructions from the target method body.
return void