PostSharp SDK 6.10 / / Class Reference / Post­Sharp.​Sdk.​Code­Model Namespace / Method­Body­Declaration Class

MethodBodyDeclaration Class

Represents the IL body of a method.
Inheritance Hierarchy
System.Object
  PostSharp.Sdk.CodeModel.Element
    PostSharp.Sdk.CodeModel.Declaration
      PostSharp.Sdk.CodeModel.MethodBodyDeclaration

Namespace:  PostSharp.Sdk.CodeModel
Assembly:  PostSharp.Compiler.Engine (in PostSharp.Compiler.Engine.dll) Version: 6.10.14.0 (6.10.14.0)
Syntax
C#
public sealed class MethodBodyDeclaration : Declaration, 
	IMethodBody, IMethodBodyElement

The MethodBodyDeclaration type exposes the following members.

Constructors
  NameDescription
Public methodMethodBodyDeclaration
Initializes a new instance of the MethodBodyDeclaration class
Properties
  NameDescription
Public propertyCustomDebuggingInformation (Inherited from Declaration.)
Public propertyHasNullStateMachineFields
Public propertyInitLocalVariables
Determines whether local variables should be initialized by the runtime to their default value.
Public propertyInstructionBlockCount
Gets the number of instruction blocks (InstructionBlock) created for the current method body.
Public propertyInstructionSequenceCount
Gets the number of sequences in the current method body.
Public propertyIsModified
Determines whether the current method body has been modified.
Public propertyLocalVariableMaxOrdinal
Gets the number of local variables.
Public propertyMaxStack
Gets or sets the maximal number of items that the runtime evaluation stack should contain.
Public propertyNullStateMachineFields
Public propertyStateMachineKickoffMethod
Public propertyStateMachineMoveNextMethod
Gets or sets MoveNext method of the state machine, if the current method is a state machine method.
Methods
  NameDescription
Public methodClearCache
Clear the cache (typically mapping to System.Reflection or, if the current element is a reference, to the related definition) of the current Element and all its children.
(Inherited from Element.)
Public methodCreateInstructionBlock
Creates an InstructionBlock for the current method body.
Public methodCreateInstructionReader()
Gets an InstructionReader for the current method body, which will resolve local variable symbols.
Public methodCreateInstructionReader(Boolean)
Gets an InstructionReader for the current method body and specify whether it should resolve local variable symbols.
Public methodCreateInstructionSequence
Creates an InstructionSequence for the current method body.
Public methodCreateLocalVariable
Creates a local variable for the current method body.
Public methodCreateOriginalInstructionReader
Gets an InstructionReader over the original and unstructured instruction stream.
Public methodDebugOutput
WriteValue the current method body (as MSIL) to the console.
Public methodDispose Obsolete.
Releases all resources used by the MethodBodyDeclaration
Public methodEnsureWritableLocalVariables
Ensure that the collection of local variables are writable.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodCode exampleForEachInstruction
Calls a specified delegate for each instruction of the current method body.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetInstructionBlockByToken
Gets an InstructionBlock given its token.
Public methodGetInstructionSequenceByToken
Gets an InstructionSequence given its token.
Public methodGetInstructionSequenceEnumerator
Gets an enumerator for all the instruction sequences (InstructionSequence) contained in the current method body.
Public methodGetLocalVariable(Int32)
Gets a LocalVariableDeclaration given its index.
Public methodGetLocalVariable(Int32, Boolean)
Gets a LocalVariableDeclaration given its index.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodRemoveLocalVariable
Removes a local variable.
Public methodToString
Returns a string that represents the current object.
(Overrides Object.ToString().)
Public methodVisit(IMethodBodyVisitor[])
Visits exception handlers, instruction blocks, instruction sequences and instructions of the current MethodBodyDeclaration using a set of visitors (IMethodBodyVisitor).
Public methodVisit(IMethodBodyVisitor[], MethodBodyVisitLevel)
Visits exception handlers, instruction blocks, instruction sequences and instructions of the current MethodBodyDeclaration using a set of visitors (IMethodBodyVisitor).
Fields
  NameDescription
Public fieldStatic memberRecomputeMaxStack
Value of the MaxStack property that specifies that the current property should be computed.
Remarks
Method bodies are owned by methods (MethodDefDeclaration).
See Also