mscorlib(4.0.0.0) API with additions
System.Reflection.MethodBody Class Reference

Provides access to the metadata and MSIL for the body of a method. More...

Collaboration diagram for System.Reflection.MethodBody:
[legend]

Public Member Functions

virtual byte [] GetILAsByteArray ()
 Returns the MSIL for the method body, as an array of bytes. More...
 

Public Attributes

virtual int LocalSignatureMetadataToken => m_localSignatureMetadataToken
 Gets a metadata token for the signature that describes the local variables for the method in metadata. More...
 
virtual IList< LocalVariableInfoLocalVariables => Array.AsReadOnly(m_localVariables)
 Gets the list of local variables declared in the method body. More...
 
virtual int MaxStackSize => m_maxStackSize
 Gets the maximum number of items on the operand stack when the method is executing. More...
 
virtual bool InitLocals => m_initLocals
 Gets a value indicating whether local variables in the method body are initialized to the default values for their types. More...
 
virtual IList< ExceptionHandlingClauseExceptionHandlingClauses => Array.AsReadOnly(m_exceptionHandlingClauses)
 Gets a list that includes all the exception-handling clauses in the method body. More...
 

Protected Member Functions

 MethodBody ()
 Initializes a new instance of the T:System.Reflection.MethodBody class. More...
 

Detailed Description

Provides access to the metadata and MSIL for the body of a method.

Definition at line 8 of file MethodBody.cs.

Constructor & Destructor Documentation

◆ MethodBody()

System.Reflection.MethodBody.MethodBody ( )
protected

Initializes a new instance of the T:System.Reflection.MethodBody class.

Definition at line 46 of file MethodBody.cs.

Member Function Documentation

◆ GetILAsByteArray()

virtual byte [] System.Reflection.MethodBody.GetILAsByteArray ( )
virtual

Returns the MSIL for the method body, as an array of bytes.

Returns
An array of type T:System.Byte that contains the MSIL for the method body.

Definition at line 52 of file MethodBody.cs.

Member Data Documentation

◆ ExceptionHandlingClauses

virtual IList<ExceptionHandlingClause> System.Reflection.MethodBody.ExceptionHandlingClauses => Array.AsReadOnly(m_exceptionHandlingClauses)

Gets a list that includes all the exception-handling clauses in the method body.

Returns
An T:System.Collections.Generic.IList`1 of T:System.Reflection.ExceptionHandlingClause objects representing the exception-handling clauses in the body of the method.

Definition at line 43 of file MethodBody.cs.

◆ InitLocals

virtual bool System.Reflection.MethodBody.InitLocals => m_initLocals

Gets a value indicating whether local variables in the method body are initialized to the default values for their types.

Returns
true if the method body contains code to initialize local variables to null for reference types, or to the zero-initialized value for value types; otherwise, false.

Definition at line 39 of file MethodBody.cs.

◆ LocalSignatureMetadataToken

virtual int System.Reflection.MethodBody.LocalSignatureMetadataToken => m_localSignatureMetadataToken

Gets a metadata token for the signature that describes the local variables for the method in metadata.

Returns
An integer that represents the metadata token.

Definition at line 26 of file MethodBody.cs.

◆ LocalVariables

virtual IList<LocalVariableInfo> System.Reflection.MethodBody.LocalVariables => Array.AsReadOnly(m_localVariables)

Gets the list of local variables declared in the method body.

Returns
An T:System.Collections.Generic.IList`1 of T:System.Reflection.LocalVariableInfo objects that describe the local variables declared in the method body.

Definition at line 30 of file MethodBody.cs.

◆ MaxStackSize

virtual int System.Reflection.MethodBody.MaxStackSize => m_maxStackSize

Gets the maximum number of items on the operand stack when the method is executing.

Returns
The maximum number of items on the operand stack when the method is executing.

Definition at line 34 of file MethodBody.cs.


The documentation for this class was generated from the following file: