Aspect that, when applied to a target, adds a custom attribute to this target.
Namespace: PostSharp.Aspects
Assembly: PostSharp.dll
Syntax
[LinesOfCodeAvoided(1)]
public sealed class CustomAttributeIntroductionAspect : ICustomAttributeIntroductionAspect, IAspect, IAspectBuildSemantics, IValidableAnnotation
Remarks
There are two ways to specify a custom attribute: either using an ObjectConstruction (to construct a new custom attribute), either a CustomAttributeData (to copy a custom attribute reflected using one of the overload of the method GetCustomAttributes(Assembly)/
note
This aspect is not a custom attribute. You have to create another aspect implementing IAspectProvider and have the method ProvideAspects(object) return instances of this aspect.
Constructors
Name | Description |
---|---|
CustomAttributeIntroductionAspect(ObjectConstruction) | Initializes a new CustomAttributeIntroductionAspect by specifying an ObjectConstruction. |
CustomAttributeIntroductionAspect(CustomAttributeData) | Initializes a new CustomAttributeIntroductionAspect by specifying a CustomAttributeData. |
Properties
Name | Description |
---|---|
CustomAttribute | Gets the construction of the custom attribute that must be applied to the target of this aspect. |