Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 /// <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));
 }
Ejemplo n.º 3
0
		// 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);
		}