PostSharpAPI ReferencePost­Sharp.​ConstraintsConstraint
Open sandboxFocus

Constraint Class

Root class for all constraints based on MulticastAttribute. A constraint is a piece validation logic executed at build time. Constraints are applied to elements of code ((Assembly, System.Type, MethodInfo, ConstructorInfo, System.Reflection.PropertyInfo, EventInfo, System.Reflection.FieldInfo, ParameterInfo) typically using multicast custom attributes, and verified at build time for every assembly using this element of code.

Implements
IConstraint
Namespace: PostSharp.Constraints
Assembly: PostSharp.dll
Syntax
public abstract class Constraint : MulticastAttribute, IConstraint

Constructors

Name Description
Constraint()

Methods

Name Description
ValidateConstraint(Object)

Validates the fact that the constraint has been applied on a valid element of code. When this method returns false, the constraint is silently ignored.