Esempio n. 1
0
    /// <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);
    }
Esempio n. 2
0
    /// <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));
    }
Esempio n. 3
0
        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));
        }
Esempio n. 4
0
        /// <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);
        }
Esempio n. 5
0
    /// <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));
    }