Exemple #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(MethodCopier.GetInstructions(generator, original, maxTranspilers));
 }
Exemple #2
0
 /// <summary>Returns the methods unmodified list of code instructions</summary>
 /// <param name="original">The original method/constructor</param>
 /// <param name="generator">Optionally an existing generator that will be used to create all local variables and labels contained in the result (if not specified, an internal generator is used)</param>
 /// <returns>A list containing all the original <see cref="CodeInstruction"/></returns>
 ///
 public static List <CodeInstruction> GetOriginalInstructions(MethodBase original, ILGenerator generator = null)
 {
     return(MethodCopier.GetInstructions(generator ?? CreateILGenerator(original), original, 0));
 }
Exemple #3
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(MethodCopier.GetInstructions(generator, original, 0));
 }
Exemple #4
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="maxTranspilers">Apply only the first count of transpilers</param>
 /// <param name="generator">Optionally an existing generator that will be used to create all local variables and labels contained in the result (if not specified, an internal generator is used)</param>
 /// <returns>A list of <see cref="CodeInstruction"/></returns>
 ///
 public static List <CodeInstruction> GetCurrentInstructions(MethodBase original, int maxTranspilers = int.MaxValue, ILGenerator generator = null)
 {
     return(MethodCopier.GetInstructions(generator ?? CreateILGenerator(), original, maxTranspilers));
 }