System.Reflection.MethodBody.GetILAsByteArray C# (CSharp) Method

GetILAsByteArray() public method

public GetILAsByteArray ( ) : byte[]
return byte[]
        public byte[] GetILAsByteArray() { return m_IL; }
        public IList<ExceptionHandlingClause> ExceptionHandlingClauses { get { return Array.AsReadOnly(m_exceptionHandlingClauses); } } 

Usage Example

		MethodBodyReader (MethodBase method)
		{
			this.method = method;

			this.body = method.GetMethodBody ();
			if (this.body == null)
				throw new ArgumentException ("Method has no body");

			var bytes = body.GetILAsByteArray ();
			if (bytes == null)
				throw new ArgumentException ("Can not get the body of the method");

			if (!(method is ConstructorInfo))
				method_arguments = method.GetGenericArguments ();

			if (method.DeclaringType != null)
				type_arguments = method.DeclaringType.GetGenericArguments ();

            if (!method.IsStatic)
                this_parameter = new ThisParameter(method.DeclaringType);


            this.parameters = method.GetParameters ();
			this.locals = body.LocalVariables;
			this.module = method.Module;
			this.il = new ByteBuffer (bytes);
			this.instructions = new List<Instruction> ((bytes.Length + 1) / 2);
		}
All Usage Examples Of System.Reflection.MethodBody::GetILAsByteArray