PostSharp SDK 6.10 / / Class Reference / Post­Sharp.​Sdk.​Aspect­Infrastructure Namespace / Method­Body­Transformation­Context Class

MethodBodyTransformationContext Class

Context information of a transformation of a method body, passed to the method Implement(MethodBodyTransformationContext).
Inheritance Hierarchy
System.Object
  PostSharp.Sdk.AspectInfrastructure.TransformationContext
    PostSharp.Sdk.AspectInfrastructure.MethodBodyTransformationContext

Namespace:  PostSharp.Sdk.AspectInfrastructure
Assembly:  PostSharp.Compiler.Engine (in PostSharp.Compiler.Engine.dll) Version: 6.10.14.0 (6.10.14.0)
Syntax
C#
public sealed class MethodBodyTransformationContext : TransformationContext

The MethodBodyTransformationContext type exposes the following members.

Properties
  NameDescription
Public propertyBindingsContainerType
Gets the type in which binding classes should be created.
Public propertyInstructionBlock
Gets the InstructionBlock in which the current transformation should emit instructions.
Public propertyIsBranched
Determines if the current pipeline instance has been branched, i.e. if there are multiple branches if the same pipeline at this stage.
Public propertyLeaveBranchTarget
Gets the InstructionSequence to which the current transformation should branch the instruction flow when exiting, instead of emitting the ret instruction.
Public propertyMethodMapping
Gets the MethodMapping that maps the context of the current InstructionBlock to the original method body.
Public propertyMethodSemantic
Gets the semantic of the method being transformed, if the method is a member of an event or a property.
(Inherited from TransformationContext.)
Public propertyMustAddSymJoinPoint
Determines whether the current transformation is expected to add a join point symbol.
(Inherited from TransformationContext.)
Public propertyOrdinal
Gets the ordinal of the current transformation in the transformation pipeline.
(Inherited from TransformationContext.)
Public propertyOriginalTargetElement
Gets the element of code to which the transformation pipeline was originally applied. The pipeline may have redirected, created a new element of code in replacement of the original one. In this case, this property contains the original element of code, and the TargetElement property contains the replacement element of code.
(Inherited from TransformationContext.)
Public propertyReturnValueVariable
Gets the local variable in which the current transformation should store the return value.
Public propertyStateMachine
Gets or sets additional information about the context. This additional information is only relevant for transformations that happen inside a MoveNext method of a state machine. This information is not deeply copied: This means that if you add two redirections while inside a MoveNext method, the result will be strange.
Public propertyTargetElement
Gets the element of code being currently transformed by the transformation pipeline. The pipeline may have created a new element of code in replacement of the original one. In this case, the OriginalTargetElement property contains the original element of code, and the current property contains the replacement element of code.
(Inherited from TransformationContext.)
Public propertyTransversalState
Gets an object allowing transformations to share state between pipelines targeting different methods of the same property or event.
(Inherited from TransformationContext.)
Methods
  NameDescription
Public methodAddRedirection(MethodBodyTransformationRedirection)
Public methodAddRedirection(InstructionBlock, InstructionSequence)
Adds a MethodBodyTransformationRedirection by specifying an instruction block (inside the current method) in which the next transformation should add its implementation, but without changing the method mapping or the local variable storing the return value.
Public methodAddRedirection(InstructionBlock, InstructionSequence, MethodMapping, LocalVariableSymbol)
Adds a MethodBodyTransformationRedirection by specifying an instruction block (typically in a different method) in which the next transformation should add its implementation, a different method mapping and a local variable storing the return value.
Public methodClone
Creates a new object that is a copy of the current instance.
(Overrides TransformationContext.Clone().)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetPipelineStateItem
Gets state information that has been previously stored with the method SetPipelineStateItem(Object, Object).
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodTerminatePipeline
Prevents further transformations of the pipeline to be executed.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
See Also