PostSharp.ILAPI 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 ((System.Reflection.Assembly, Type, System.Reflection.MethodInfo, System.Reflection.ConstructorInfo, PropertyInfo, System.Reflection.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() PostSharp.Constraints.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.