Table of Contents

Class ILContext

Namespace
MonoMod.Cil
Assembly
MonoMod.Utils.dll
An IL manipulation "context" with various helpers and direct access to the MethodBody.
public class ILContext
Inheritance
ILContext

Constructors

ILContext(MethodDefinition)

Properties

Body
The manipulated method body.
IL
The manipulated method's IL processor.
Instrs
The manipulated method instructions.
IsReadOnly
Has the context been made read-only? No further method access is possible, but the context has not yet been disposed.
Labels
A readonly list of all defined labels.
Method
The manipulated method.
Module
The manipulated method's module.

Methods

AddReference<T>(in T?)
Bind an arbitary object to an ILContext for static retrieval.
At(Instruction)
At(ILLabel)
At(int)
DefineLabel()
Define a new label to be marked with a cursor.
DefineLabel(Instruction)
Define a new label pointing at a given instruction.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Dispose(bool)
~ILContext()
GetIncomingLabels(Instruction?)
Obtain all labels pointing at the given instruction.
GetReferenceCell(int)
GetReference<T>(int)
Import(FieldInfo)
See ImportReference(FieldInfo)
Import(MethodBase)
See ImportReference(MethodBase)
Import(Type)
See ImportReference(Type)
IndexOf(Instruction?)
Determine the index of a given instruction.
Invoke(Manipulator)
Invoke a given manipulator callback.
MakeReadOnly()
Mark this ILContext as read-only and prevent this context from further accessing the originally passed method.
SetReference<T>(int, in T?)
ToString()
Obtain a string representation of this context (method ID and body).

Events

OnDispose
Events which run when the context will be disposed.