/// <summary> /// Initializes a new instance of the <see cref="ILReader"/> class. /// </summary> /// <param name="method"> /// The method. /// </param> public ILReader(MethodInfo method) { if (method == null) { throw new ArgumentNullException("method"); } this.intermediateLanguageProvider = ILReader.CreateILReaderProvider(method); }
/// <summary> /// Creates the IL reader provider. /// </summary> /// <param name="methodInfo">The MethodInfo object that represents the method to read..</param> /// <returns> /// The ILReader provider. /// </returns> private static IILReaderProvider CreateILReaderProvider(MethodInfo methodInfo) { IILReaderProvider reader = DynamicILReaderProvider.Create(methodInfo); if (reader != null) { return(reader); } return(new ILReaderProvider(methodInfo)); }
private static IILReaderProvider CreateILReaderProvider(MethodInfo methodInfo, byte[] il = null) { #if FULL IILReaderProvider reader = DynamicILReaderProvider.Create(methodInfo, il); if (reader != null) { return(reader); } #endif return(new ILReaderProvider(methodInfo, il)); }
/// <summary> /// Initializes a new instance of the <see cref="ILReader"/> class. /// </summary> public ILReader(MethodInfo method, byte[] il = null) { //au: il added because the caller itself gets IL array and does nothing if it's too big to disassemble. To avoid getting IL 2 times. if (method == null) { throw new ArgumentNullException("method"); } this.intermediateLanguageProvider = ILReader.CreateILReaderProvider(method, il); }
/// <summary> /// Creates the IL reader provider. /// </summary> /// <param name="methodInfo">The MethodInfo object that represents the method to read..</param> /// <returns> /// The ILReader provider. /// </returns> private static IILReaderProvider CreateILReaderProvider(MethodInfo methodInfo) { IILReaderProvider reader = DynamicILReaderProvider.Create(methodInfo); return(reader ?? new ILReaderProvider(methodInfo)); }