C# Class LinFu.AOP.Cecil.InterceptFieldAccess

Represents a MethodRewriter that intercepts calls to field getters and setters and redirects those calls to a IFieldInterceptor instance.
Inheritance: LinFu.AOP.Cecil.InstructionSwapper
ファイルを表示 Open project: philiplaureano/LinFu

Public Methods

Method Description
AddLocals ( Mono.Cecil.MethodDefinition hostMethod ) : void

Adds locals to the target method.

ImportReferences ( Mono.Cecil.ModuleDefinition module ) : void

Adds references to the target module.

InterceptFieldAccess ( bool>.Func filter ) : System

Initializes a new instance of the InterceptFieldAccess class.

InterceptFieldAccess ( IFieldFilter filter ) : System

Initializes a new instance of the InterceptFieldAccess class.

Protected Methods

Method Description
Replace ( Instruction oldInstruction, Mono.Cecil.MethodDefinition hostMethod, Mono.Cecil.Cil.CilWorker IL ) : void

Replaces the oldInstruction with a set of new instructions.

ShouldReplace ( Instruction oldInstruction, Mono.Cecil.MethodDefinition hostMethod ) : bool

Determines whether or not the method rewriter should replace the oldInstruction.

The InterceptFieldAccess class only modifies instructions that get or set the value of static and instance fields.

Private Methods

Method Description
InterceptFieldAccess ( ) : System

Method Details

AddLocals() public method

Adds locals to the target method.
public AddLocals ( Mono.Cecil.MethodDefinition hostMethod ) : void
hostMethod Mono.Cecil.MethodDefinition The method to be modified
return void

ImportReferences() public method

Adds references to the target module.
public ImportReferences ( Mono.Cecil.ModuleDefinition module ) : void
module Mono.Cecil.ModuleDefinition The module that will be modified.
return void

InterceptFieldAccess() public method

Initializes a new instance of the InterceptFieldAccess class.
public InterceptFieldAccess ( bool>.Func filter ) : System
filter bool>.Func The filter that determines which fields should be intercepted.
return System

InterceptFieldAccess() public method

Initializes a new instance of the InterceptFieldAccess class.
public InterceptFieldAccess ( IFieldFilter filter ) : System
filter IFieldFilter The filter that determines which fields should be intercepted.
return System

Replace() protected method

Replaces the oldInstruction with a set of new instructions.
protected Replace ( Instruction oldInstruction, Mono.Cecil.MethodDefinition hostMethod, Mono.Cecil.Cil.CilWorker IL ) : void
oldInstruction Mono.Cecil.Cil.Instruction The instruction currently being evaluated.
hostMethod Mono.Cecil.MethodDefinition The method that contains the target instruction.
IL Mono.Cecil.Cil.CilWorker The CilWorker that will be used to emit the method body instructions.
return void

ShouldReplace() protected method

Determines whether or not the method rewriter should replace the oldInstruction.
The InterceptFieldAccess class only modifies instructions that get or set the value of static and instance fields.
protected ShouldReplace ( Instruction oldInstruction, Mono.Cecil.MethodDefinition hostMethod ) : bool
oldInstruction Mono.Cecil.Cil.Instruction The instruction that is currently being evaluated.
hostMethod Mono.Cecil.MethodDefinition The method that hosts the current instruction.
return bool