MethodBodyTransformationContext Class |
Context information of a transformation of a method body, passed to the method Implement(MethodBodyTransformationContext).
System.Object
PostSharp.Sdk.AspectInfrastructure.TransformationContext
PostSharp.Sdk.AspectInfrastructure.MethodBodyTransformationContext
PostSharp.Sdk.AspectInfrastructure.TransformationContext
PostSharp.Sdk.AspectInfrastructure.MethodBodyTransformationContext
Namespace: PostSharp.Sdk.AspectInfrastructure
Assembly: PostSharp.Compiler.Engine (in PostSharp.Compiler.Engine.dll) Version: 2023.0.3.0 (2023.0.3.0)
C#
public sealed class MethodBodyTransformationContext : TransformationContext
The MethodBodyTransformationContext type exposes the following members.
Name | Description | |
---|---|---|
BindingsContainerType |
Gets the type in which binding classes should be created.
| |
InstructionBlock |
Gets the InstructionBlock in which the current transformation
should emit instructions.
| |
IsBranched |
Determines if the current pipeline instance has been branched, i.e. if there
are multiple branches if the same pipeline at this stage.
| |
LeaveBranchTarget |
Gets the InstructionSequence to which the current transformation should branch the
instruction flow when exiting, instead of emitting the ret instruction.
| |
MethodMapping |
Gets the MethodMapping that maps the context of the current InstructionBlock
to the original method body.
| |
MethodSemantic |
Gets the semantic of the method being transformed, if the method is a member of an event or a property.
(Inherited from TransformationContext.) | |
MustAddSymJoinPoint |
Determines whether the current transformation is expected to add a join point symbol.
(Inherited from TransformationContext.) | |
Ordinal |
Gets the ordinal of the current transformation in the transformation pipeline.
(Inherited from TransformationContext.) | |
OriginalTargetElement |
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.) | |
ReturnValueVariable |
Gets the local variable in which the current transformation should store the return value.
| |
StateMachine |
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.
| |
TargetElement |
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.) | |
TransversalState |
Gets an object allowing transformations to share state between pipelines targeting different methods of the same
property or event.
(Inherited from TransformationContext.) |
Name | Description | |
---|---|---|
AddRedirection(MethodBodyTransformationRedirection) | ||
AddRedirection(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.
| |
AddRedirection(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.
| |
Clone | Creates a new object that is a copy of the current instance. (Overrides TransformationContext.Clone().) | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetPipelineStateItem |
Gets state information that has been previously stored with the method SetPipelineStateItem(Object, Object).
| |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
TerminatePipeline |
Prevents further transformations of the pipeline to be executed.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |