Table of Contents

Method Goto

Namespace
MonoMod.Cil
Assembly
MonoMod.Utils.dll

Goto(Instruction?, MoveType, bool)

Move the cursor to a target instruction. All other movements go through this.
public ILCursor Goto(Instruction? insn, MoveType moveType = MoveType.Before, bool setTarget = false)

Parameters

insn Instruction
The target instruction
moveType MoveType
Where to move in relation to the target instruction and incoming labels (branches)
setTarget bool
Whether to set the `SearchTarget` and skip the target instruction with the next search function

Returns

ILCursor
this

Goto(int, MoveType, bool)

Move the cursor to a target index. Supports negative indexing. See Goto(Instruction?, MoveType, bool)
public ILCursor Goto(int index, MoveType moveType = MoveType.Before, bool setTarget = false)

Parameters

index int
moveType MoveType
setTarget bool

Returns

ILCursor
this