ILManipulationInfo Class
Definition
Section titled “Definition”A manipulation info containing the MonoMod.Cil.ILContext intended for manipulation and an untouched MonoMod.Cil.ILContext useful for observing the untouched state, including the original method as a MethodBase if it exists.
public class ILManipulationInfoInheritance object
Constructors
Section titled “Constructors”ILManipulationInfo(ILContext, MethodBase?, out Action)
Section titled “ILManipulationInfo(ILContext, MethodBase?, out Action)”A manipulation info containing the MonoMod.Cil.ILContext intended for manipulation and an untouched MonoMod.Cil.ILContext useful for observing the untouched state, including the original method as a MethodBase if it exists.
public ILManipulationInfo(ILContext il, MethodBase? original, out Action invokeOnManipulatorFinished)Parameters
Section titled “Parameters”il MonoMod.Cil.ILContext
The main MonoMod.Cil.ILContext for manipulation.
original MethodBase
The original method if it exists.
invokeOnManipulatorFinished Action
A delegate which invokes an event which should run right after the manipulator method this ILManipulationInfo was passed to returns.
ILManipulationInfo(ILContext, MethodBase?, ReadOnlyCollection<Instruction>?)
Section titled “ILManipulationInfo(ILContext, MethodBase?, ReadOnlyCollection<Instruction>?)”A manipulation info containing the MonoMod.Cil.ILContext intended for manipulation and an untouched MonoMod.Cil.ILContext useful for observing the untouched state, including the original method as a MethodBase if it exists.
[Obsolete("Use ILManipulationInfo(ILContext il, MethodBase? original) instead.", true)]public ILManipulationInfo(ILContext il, MethodBase? original, ReadOnlyCollection<Instruction>? originalInstructions)Parameters
Section titled “Parameters”il MonoMod.Cil.ILContext
The main MonoMod.Cil.ILContext for manipulation.
original MethodBase
The original method if it exists.
originalInstructions ReadOnlyCollection<Instruction>
The original instructions of the method.
Properties
Section titled “Properties”Original
Section titled “Original”The original method if it exists.
public MethodBase? Original { get; }Context
Section titled “Context”The MonoMod.Cil.ILContext used for manipulating the target method.
public ILContext Context { get; }OriginalInstructions
Section titled “OriginalInstructions”A list of the original instructions before the method was manipulated.
public ReadOnlyCollection<Instruction> OriginalInstructions { get; }Remarks
Section titled “Remarks”This list has the same instruction instances as the current Context, meaning some may have been modified. For unmanipulated instructions, see UnmanipulatedContext.
UnmanipulatedContext
Section titled “UnmanipulatedContext”Similar to Context except this is untouched and won’t be used for anything as it is just the original method before anyone manipulated it. This is purely for observing the unmanipulated state of the original method.
This can for example be used by an MonoMod.Cil.ILContext manipulation API like MonoDetour.ILWeaver to automagically resolve incompatibilities due to instruction matching where another mod might have inserted harmless instructions somewhere between.
public ILContext UnmanipulatedContext { get; }Methods
Section titled “Methods”ToString()
Section titled “ToString()”Returns a string presentation of the method body’s instructions with with recalculated offsets and a visualized stack size, try catch ranges, incoming branch annotations, and analyzed error annotations.
public override string ToString()Returns
Section titled “Returns”string
A rich string presentation of the method body’s instructions.
Events
Section titled “Events”OnManipulatorFinished
Section titled “OnManipulatorFinished”Event which runs right after the manipulator method this ILManipulationInfo was passed to returns.
public event Action? OnManipulatorFinished