C# Class Mono.Cecil.Inject.InjectionDefinition

The core class containing all the injector methods.
Mostra file Open project: denikson/Mono.Cecil.Inject Class Usage Examples

Private Properties

Property Type Description
Assert void
InjectionDefinition System

Public Methods

Method Description
Inject ( Instruction startCode, int token, InjectDirection direction = InjectDirection.Before ) : void

Inject the call of the injection method into the target.

Inject ( int startCode, int token, InjectDirection direction = InjectDirection.Before ) : void

Inject the call of the injection method into the target.

InjectionDefinition ( MethodDefinition injectTarget, MethodDefinition injectMethod, InjectFlags flags, int localVarIDs = null ) : System

Attempts to construct an instance of InjectionDefinition by linking the injection method with the injection target (the method to be injected). The way how the method is injected is specified by the injection flags. If the injection method does not match the criteria set by the injection flags, an exception will be thrown.

Private Methods

Method Description
Assert ( bool val, string message ) : void
InjectionDefinition ( ) : System

Method Details

Inject() public method

Inject the call of the injection method into the target.
public Inject ( Instruction startCode, int token, InjectDirection direction = InjectDirection.Before ) : void
startCode Mono.Cecil.Cil.Instruction The instruction from which to start injecting.
token int /// If is specified, the value of this parameter will be passed as a /// parameter to the injection method. ///
direction InjectDirection The direction in which to insert the call: either above the start code or below it.
return void

Inject() public method

Inject the call of the injection method into the target.
public Inject ( int startCode, int token, InjectDirection direction = InjectDirection.Before ) : void
startCode int /// The index of the instruction from which to start injecting. If positive, will count from the /// beginning of the method. If negative, will count from the end. For instance, -1 is the method's last instruction /// and 0 is the first. ///
token int /// If is specified, the value of this parameter will be passed as a /// parameter to the injection method. ///
direction InjectDirection The direction in which to insert the call: either above the start code or below it.
return void

InjectionDefinition() public method

Attempts to construct an instance of InjectionDefinition by linking the injection method with the injection target (the method to be injected). The way how the method is injected is specified by the injection flags. If the injection method does not match the criteria set by the injection flags, an exception will be thrown.
public InjectionDefinition ( MethodDefinition injectTarget, MethodDefinition injectMethod, InjectFlags flags, int localVarIDs = null ) : System
injectTarget MethodDefinition The method that will be injected.
injectMethod MethodDefinition The method which to inject.
flags InjectFlags Injection flags that specify what values to pass to the injection method and how to inject it.
localVarIDs int /// An array of indicies of local variables to pass to the injection method. Used only if /// is specified, otherwise ignored. ///
return System