Skip to content

ILManipulationInfo Class

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.

C#
public class ILManipulationInfo

Inheritance object

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.

C#
public ILManipulationInfo(ILContext il, MethodBase? original, out Action invokeOnManipulatorFinished)

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.

C#
[Obsolete("Use ILManipulationInfo(ILContext il, MethodBase? original) instead.", true)]
public ILManipulationInfo(ILContext il, MethodBase? original, ReadOnlyCollection<Instruction>? originalInstructions)

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.

The original method if it exists.

C#
public MethodBase? Original { get; }

The MonoMod.Cil.ILContext used for manipulating the target method.

C#
public ILContext Context { get; }

A list of the original instructions before the method was manipulated.

C#
public ReadOnlyCollection<Instruction> OriginalInstructions { get; }

This list has the same instruction instances as the current Context, meaning some may have been modified. For unmanipulated instructions, see 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.

C#
public ILContext UnmanipulatedContext { get; }

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.

C#
public override string ToString()

string
A rich string presentation of the method body’s instructions.

Event which runs right after the manipulator method this ILManipulationInfo was passed to returns.

C#
public event Action? OnManipulatorFinished

Action