PostSharp6.1/API Reference/Post­Sharp.​Aspects.​Dependencies Namespace/Aspect­Effect­Dependency­Attribute Class

AspectEffectDependencyAttribute Class

Specifies an aspect dependency matching aspects or advices having a given effect.
Inheritance Hierarchy
System.Object
  System.Attribute
    PostSharp.Aspects.Dependencies.AspectDependencyAttribute
      PostSharp.Aspects.Dependencies.AspectEffectDependencyAttribute

Namespace:  PostSharp.Aspects.Dependencies
Assembly:  PostSharp (in PostSharp.dll) Version: 6.1.23.0 (6.1.23.0)
Syntax
C#
public sealed class AspectEffectDependencyAttribute : AspectDependencyAttribute

The AspectEffectDependencyAttribute type exposes the following members.

Constructors
  NameDescription
Public methodAspectEffectDependencyAttribute(AspectDependencyAction, String)
Initializes a new AspectEffectDependencyAttribute without specifying the position, implicitly set to Any.
Public methodAspectEffectDependencyAttribute(AspectDependencyAction, AspectDependencyPosition, String)
Initializes a new AspectEffectDependencyAttribute and specifies a position.
Properties
  NameDescription
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 propertyEffect
Gets the effect that the aspects or advices must have in order to match the current dependency.
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 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.)
Remarks

All aspects (except the ones that have an empty implementation) have an effect on the program execution. The current custom attribute allows to express dependencies to aspects according to their effect.

The list of standard effects is given in class StandardEffects. All advices have implicitly the effect Custom. Most advices also have the effect ChangeControlFlow, because they are able to modify the control flow (for instance, skip the execution of the intercepted method or throwing an exception). An aspect or advice can declare it does not have a given effect by using the WaiveAspectEffectAttribute custom attribute.

Remarks
See Also