public static ILCursor?Goto(this ILCursor?cursor, Action onFail, Direction direction, MoveType moveType, params MatchExpr[] conditions) { if (cursor is not ILCursor cur) { return(null); } if (cursor.Goto(direction, moveType, conditions) is not ILCursor res) { res = null; onFail(); } return(res); }
public static ILCursor?OP_Branch(this ILCursor?cursor, ILLabel label) => cursor?.Emit(OpCodes.Br, label);
public static ILCursor?OP_Box(this ILCursor?cursor, Type type) => cursor?.OP_Box(type);
public static ILCursor?OP_Box <T>(this ILCursor?cursor) where T : struct => cursor?.OP_Box(typeof(T));
public static ILCursor?OP_Branch_Ne(this ILCursor?cursor, ILLabel target) => cursor?.Emit(OpCodes.Bne_Un, target);
public static ILCursor?Goto(this ILCursor?cursor, MoveType moveType, ILLabel label) { cursor?.GotoLabel(label, moveType); return(cursor); }
public static ILCursor?OP_StLocal(this ILCursor?cursor, Int32 index) => cursor?.Emit(OpCodes.Stloc, index);
public static ILCursor?OP_Call <TDelegate>(this ILCursor?cursor, TDelegate method) where TDelegate : Delegate { cursor?.EmitDelegate <TDelegate>(method); return(cursor); }
public static ILCursor?OP_And(this ILCursor?cursor) => cursor?.Emit(OpCodes.And);
public static ILCursor?OP_Add_Ovf(this ILCursor?cursor, Boolean unsigned = false) => cursor?.Emit(unsigned ? OpCodes.Add_Ovf_Un : OpCodes.Add_Ovf);
public static ILCursor?Goto(this ILCursor?cursor, Direction direction, MoveType moveType, params MatchExpr[] conditions) => direction switch {
public static ILCursor?Goto(this ILCursor?cursor, Action onFail, MoveType moveType, params MatchExpr[] conditions) => cursor.Goto(onFail, Direction.Next, MoveType.AfterLabel, conditions);
public static ILCursor?Goto(this ILCursor?cursor, MoveType moveType, params MatchExpr[] conditions) => cursor.Goto(Direction.Next, moveType, conditions);
public static ILCursor?Goto(this ILCursor?cursor, Direction direction, params MatchExpr[] conditions) => cursor.Goto(direction, MoveType.AfterLabel, conditions);
public static ILCursor?OP_Breakpoint(this ILCursor?cursor) => cursor?.Emit(OpCodes.Break);
public static ILCursor?OP_Arglist(this ILCursor?cursor) => cursor?.Emit(OpCodes.Arglist);
public static ILCursor?OP_Branch_True(this ILCursor?cursor, ILLabel target) => cursor?.Emit(OpCodes.Brtrue, target);
public static ILCursor?OP_Branch_Eq(this ILCursor?cursor, ILLabel target) => cursor?.Emit(OpCodes.Beq, target);
public static ILCursor?OP_New(this ILCursor?cursor, ConstructorInfo constructor) => cursor?.Emit(OpCodes.Newobj, constructor);
public static ILCursor?OP_Branch_Lt(this ILCursor?cursor, ILLabel target, Boolean unsigned = false) => cursor?.Emit(unsigned ? OpCodes.Blt_Un : OpCodes.Blt_Un, target);
public static ILCursor?OP_LdLocal(this ILCursor?cursor, Int32 index) => index switch { 0 => cursor?.Emit(OpCodes.Ldloc_0),
public static ILCursor?Goto(this ILCursor?cursor, ILLabel label) => cursor.Goto(MoveType.AfterLabel, label);