internal static List <ILInstruction> GetInstructions(ILGenerator generator, MethodBase method) { if (method == null) { throw new ArgumentNullException("Method cannot be null"); } var reader = new MethodBodyReader(method, generator); reader.DeclareVariables(null); reader.ReadInstructions(); return(reader.ilInstructions); }
/// <summary>Gets all instructions from a method</summary> /// <param name="generator">The generator (for defining labels)</param> /// <param name="method">The original method</param> /// <returns>The instructions</returns> /// internal static List <ILInstruction> GetInstructions(ILGenerator generator, MethodBase method) { return(MethodBodyReader.GetInstructions(generator, method)); }
// pass in a generator that will create local variables for the returned instructions // public static List<ILInstruction> GetInstructions(ILGenerator generator, MethodBase method) { return MethodBodyReader.GetInstructions(generator, method); }