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