Post­Sharp Documentation / API Reference / Post­Sharp.​Aspects Namespace / Custom­Attribute­Introduction­Aspect Class

CustomAttributeIntroductionAspect Class

Aspect that, when applied to a target, adds a custom attribute to this target.
Inheritance Hierarchy
System.Object
  PostSharp.Aspects.CustomAttributeIntroductionAspect

Namespace:  PostSharp.Aspects
Assembly:  PostSharp (in PostSharp.dll) Version: 5.0.38.0 (5.0.38.0)
Syntax
C#
public sealed class CustomAttributeIntroductionAspect : ICustomAttributeIntroductionAspect, 
	IAspect, IAspectBuildSemantics, IValidableAnnotation

The CustomAttributeIntroductionAspect type exposes the following members.

Constructors
  NameDescription
Public methodCustomAttributeIntroductionAspect(CustomAttributeData)
Initializes a new CustomAttributeIntroductionAspect by specifying a CustomAttributeData.
Public methodCustomAttributeIntroductionAspect(ObjectConstruction)
Initializes a new CustomAttributeIntroductionAspect by specifying an ObjectConstruction.
Properties
  NameDescription
Public propertyCustomAttribute
Gets the construction of the custom attribute that must be applied to the target of this aspect.
Extension Methods
  NameDescription
Public Extension MethodQueryInterface<T>
Gets the implementation of a specified interface for the specified object.
(Defined by QueryInterfaceExtensions.)
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 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.
See Also