Apply custom validators
Last updated
Was this helpful?
Last updated
Was this helpful?
Requires: , (constraints).
Validation feature allows to associate a custom user-made validator with a settings type. Validation occurs during and results in binding errors for incorrect settings.
There are also built-in validation constraints you can use to create a custom validator. Just inherit your validator class from ConstraintsValidator
and override a method returning constraints to be checked:
Here's a list of all currently implemented constraint types:
NotNullConstraint
for arbitrary reference types;
NotNullOrEmptyConstraint
for strings;
NotNullOrWhitespaceConstraint
for strings;
RangeConstraint
, LessConstraint
, LessOrEqualConstraint
, GreaterConstraint
and GreaterOrEqualConstraint
for any types that implement IComparable
;
UniqueConstraint
to check that a set of field/properties only contains unique values;