Post­Sharp Documentation / API Reference / Post­Sharp.​Aspects.​Dependencies Namespace / Aspect­Role­Dependency­Attribute Class

AspectRoleDependencyAttribute Class

Specifies an aspect dependency matching aspects or advices that are a part of a given role.
Inheritance Hierarchy

Namespace:  PostSharp.Aspects.Dependencies
Assembly:  PostSharp (in PostSharp.dll) Version: (
public sealed class AspectRoleDependencyAttribute : AspectDependencyAttribute

The AspectRoleDependencyAttribute type exposes the following members.

Public methodAspectRoleDependencyAttribute(AspectDependencyAction, String)
Initializes a new AspectEffectDependencyAttribute without specifying the position, implicitly set to Any.
Public methodAspectRoleDependencyAttribute(AspectDependencyAction, AspectDependencyPosition, String)
Initializes a new AspectRoleDependencyAttribute and specifies a position.
Public propertyAction
Gets the dependency action, i.e. the kind of relationship specified by the dependency (Order, Require, Conflict, or Commute).
(Inherited from AspectDependencyAttribute.)
Public propertyIsWarning
If true, specifies that the constraint (of type Require or Conflict) should emit a warning instead of an error if not respected.
(Inherited from AspectDependencyAttribute.)
Public propertyPosition
Gets the position of the current dependency, i.e. actually the position of the other aspect or advices with respect to the one related to this dependency.
(Inherited from AspectDependencyAttribute.)
Public propertyRole
Gets the role that the aspects or advices must be a part of in order to match the current dependency.
Public propertyTarget
Determines the target (Default or Type) to which the aspect dependency apply.
(Inherited from AspectDependencyAttribute.)
Public propertyTargetType
Aspect type to which this dependency applies. This property is required when the custom attribute is applied at assembly level. It is ignored when applied on class or method level.
(Inherited from AspectDependencyAttribute.)
Extension Methods
Public Extension MethodQueryInterface<T>
Gets the implementation of a specified interface for the specified object.
(Defined by QueryInterfaceExtensions.)

A role describes what the aspect actually does. A list of standard roles is available on the class StandardRoles. Aspect vendors are encouraged to enroll their aspects in one of these roles whenever it makes sense, and to document the other roles they have used.

An aspect or advice can be enrolled in a role by using the ProvideAspectRoleAttribute custom attribute.

See Also