Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
 public static ILCursor?OP_Branch(this ILCursor?cursor, ILLabel label) => cursor?.Emit(OpCodes.Br, label);
Ejemplo n.º 3
0
 public static ILCursor?OP_Box(this ILCursor?cursor, Type type) => cursor?.OP_Box(type);
Ejemplo n.º 4
0
 public static ILCursor?OP_Box <T>(this ILCursor?cursor) where T : struct => cursor?.OP_Box(typeof(T));
Ejemplo n.º 5
0
 public static ILCursor?OP_Branch_Ne(this ILCursor?cursor, ILLabel target) => cursor?.Emit(OpCodes.Bne_Un, target);
Ejemplo n.º 6
0
 public static ILCursor?Goto(this ILCursor?cursor, MoveType moveType, ILLabel label)
 {
     cursor?.GotoLabel(label, moveType);
     return(cursor);
 }
Ejemplo n.º 7
0
 public static ILCursor?OP_StLocal(this ILCursor?cursor, Int32 index) => cursor?.Emit(OpCodes.Stloc, index);
Ejemplo n.º 8
0
 public static ILCursor?OP_Call <TDelegate>(this ILCursor?cursor, TDelegate method) where TDelegate : Delegate
 {
     cursor?.EmitDelegate <TDelegate>(method);
     return(cursor);
 }
Ejemplo n.º 9
0
 public static ILCursor?OP_And(this ILCursor?cursor) => cursor?.Emit(OpCodes.And);
Ejemplo n.º 10
0
 public static ILCursor?OP_Add_Ovf(this ILCursor?cursor, Boolean unsigned = false) => cursor?.Emit(unsigned ? OpCodes.Add_Ovf_Un : OpCodes.Add_Ovf);
Ejemplo n.º 11
0
 public static ILCursor?Goto(this ILCursor?cursor, Direction direction, MoveType moveType, params MatchExpr[] conditions) => direction switch
 {
Ejemplo n.º 12
0
 public static ILCursor?Goto(this ILCursor?cursor, Action onFail, MoveType moveType, params MatchExpr[] conditions) => cursor.Goto(onFail, Direction.Next, MoveType.AfterLabel, conditions);
Ejemplo n.º 13
0
 public static ILCursor?Goto(this ILCursor?cursor, MoveType moveType, params MatchExpr[] conditions) => cursor.Goto(Direction.Next, moveType, conditions);
Ejemplo n.º 14
0
 public static ILCursor?Goto(this ILCursor?cursor, Direction direction, params MatchExpr[] conditions) => cursor.Goto(direction, MoveType.AfterLabel, conditions);
Ejemplo n.º 15
0
 public static ILCursor?OP_Breakpoint(this ILCursor?cursor) => cursor?.Emit(OpCodes.Break);
Ejemplo n.º 16
0
 public static ILCursor?OP_Arglist(this ILCursor?cursor) => cursor?.Emit(OpCodes.Arglist);
Ejemplo n.º 17
0
 public static ILCursor?OP_Branch_True(this ILCursor?cursor, ILLabel target) => cursor?.Emit(OpCodes.Brtrue, target);
Ejemplo n.º 18
0
 public static ILCursor?OP_Branch_Eq(this ILCursor?cursor, ILLabel target) => cursor?.Emit(OpCodes.Beq, target);
Ejemplo n.º 19
0
 public static ILCursor?OP_New(this ILCursor?cursor, ConstructorInfo constructor) => cursor?.Emit(OpCodes.Newobj, constructor);
Ejemplo n.º 20
0
 public static ILCursor?OP_Branch_Lt(this ILCursor?cursor, ILLabel target, Boolean unsigned = false) => cursor?.Emit(unsigned ? OpCodes.Blt_Un : OpCodes.Blt_Un, target);
Ejemplo n.º 21
0
 public static ILCursor?OP_LdLocal(this ILCursor?cursor, Int32 index) => index switch
 {
     0 => cursor?.Emit(OpCodes.Ldloc_0),
Ejemplo n.º 22
0
 public static ILCursor?Goto(this ILCursor?cursor, ILLabel label) => cursor.Goto(MoveType.AfterLabel, label);