Implementation of IScalarConstraint based on MulticastAttribute.
Inheritance
Namespace: PostSharp.Constraints
Assembly: PostSharp.dll
Syntax
public class ScalarConstraint : Constraint, IScalarConstraint, IConstraintRemarks
A scalar constraint validates the target declaration itself, for instance a type, member or parameter. It is validated when the assembly that contains the target declaration is processed. To validate how other code uses the declaration, use ReferentialConstraint instead.
Override ValidateCode(object), cast the target to the reflection type that matches the multicast targets of the constraint, and emit warnings or errors with Message. Combine the constraint with Inheritance to validate all types derived from the target type.
Constructors
| Name | Description |
|---|---|
| ScalarConstraint() |
Methods
| Name | Description |
|---|---|
| ValidateCode(object) | Validates the element of code to which the constraint is applied. |