예제 #1
0
 /// <summary>Returns the methods current list of code instructions after all existing transpilers have been applied</summary>
 /// <param name="original">The original method/constructor</param>
 /// <param name="generator">A new generator that now contains all local variables and labels contained in the result</param>
 /// <param name="maxTranspilers">Apply only the first count of transpilers</param>
 /// <returns>A list of <see cref="CodeInstruction"/></returns>
 ///
 public static List <CodeInstruction> GetCurrentInstructions(MethodBase original, out ILGenerator generator, int maxTranspilers = int.MaxValue)
 {
     generator = CreateILGenerator(original);
     return(PatchFunctions.ApplyTranspilers(original, generator, maxTranspilers).ToList());
 }
예제 #2
0
 /// <summary>Returns the methods unmodified list of code instructions</summary>
 /// <param name="original">The original method/constructor</param>
 /// <param name="generator">A new generator that now contains all local variables and labels contained in the result</param>
 /// <returns>A list containing all the original <see cref="CodeInstruction"/></returns>
 ///
 public static List <CodeInstruction> GetOriginalInstructions(MethodBase original, out ILGenerator generator)
 {
     generator = CreateILGenerator(original);
     return(PatchFunctions.ApplyTranspilers(original, generator).ToList());
 }