mscorlib(4.0.0.0) API with additions
MethodBody.cs
3 
4 namespace System.Reflection
5 {
7  [ComVisible(true)]
8  public class MethodBody
9  {
10  private byte[] m_IL;
11 
12  private ExceptionHandlingClause[] m_exceptionHandlingClauses;
13 
14  private LocalVariableInfo[] m_localVariables;
15 
16  internal MethodBase m_methodBase;
17 
18  private int m_localSignatureMetadataToken;
19 
20  private int m_maxStackSize;
21 
22  private bool m_initLocals;
23 
26  public virtual int LocalSignatureMetadataToken => m_localSignatureMetadataToken;
27 
30  public virtual IList<LocalVariableInfo> LocalVariables => Array.AsReadOnly(m_localVariables);
31 
34  public virtual int MaxStackSize => m_maxStackSize;
35 
39  public virtual bool InitLocals => m_initLocals;
40 
43  public virtual IList<ExceptionHandlingClause> ExceptionHandlingClauses => Array.AsReadOnly(m_exceptionHandlingClauses);
44 
46  protected MethodBody()
47  {
48  }
49 
52  public virtual byte[] GetILAsByteArray()
53  {
54  return m_IL;
55  }
56  }
57 }
virtual IList< ExceptionHandlingClause > ExceptionHandlingClauses
Gets a list that includes all the exception-handling clauses in the method body.
Definition: MethodBody.cs:43
virtual int LocalSignatureMetadataToken
Gets a metadata token for the signature that describes the local variables for the method in metadata...
Definition: MethodBody.cs:26
Definition: __Canon.cs:3
virtual bool InitLocals
Gets a value indicating whether local variables in the method body are initialized to the default val...
Definition: MethodBody.cs:39
virtual IList< LocalVariableInfo > LocalVariables
Gets the list of local variables declared in the method body.
Definition: MethodBody.cs:30
Provides access to the metadata and MSIL for the body of a method.
Definition: MethodBody.cs:8
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition: Array.cs:17
Provides information about methods and constructors.
Definition: MethodBase.cs:19
Represents a collection of objects that can be individually accessed by index.
Definition: IList.cs:9
virtual int MaxStackSize
Gets the maximum number of items on the operand stack when the method is executing.
Definition: MethodBody.cs:34
virtual byte [] GetILAsByteArray()
Returns the MSIL for the method body, as an array of bytes.
Definition: MethodBody.cs:52
Discovers the attributes of a local variable and provides access to local variable metadata.
MethodBody()
Initializes a new instance of the T:System.Reflection.MethodBody class.
Definition: MethodBody.cs:46
Represents a clause in a structured exception-handling block.