PostSharp SDK 2023.0 / / Class Reference / Post­Sharp.​Sdk.​Aspect­Infrastructure Namespace / Transformation­Context Class / Transformation­Context Properties / Transformation­Context.​Original­Target­Element Property

TransformationContext.OriginalTargetElement Property

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.

Namespace:  PostSharp.Sdk.AspectInfrastructure
Assembly:  PostSharp.Compiler.Engine (in PostSharp.Compiler.Engine.dll) Version: 2023.0.3.0 (2023.0.3.0)
public MetadataDeclaration OriginalTargetElement { get; }

Property Value

Type: MetadataDeclaration

If the element wasn't replaced, then this is the same as TargetElement.

See Also