EnumDefinedValidator Checked-in

Topics: Development Team Discussion, User Discussion
Coordinator
Sep 16, 2007 at 4:51 PM
Edited Sep 16, 2007 at 4:52 PM
I've added an EnumDefinedValidator, its related Attribute, Data and Design Node.

It validates a given Enum value is within the range of the Enum's defined values.

I also updated the DefaultValidators which makes it useful for pre-condition validation

public enum Bar
{
A,
B
}

public void Func(Bar bar)
{
ArgumentValidation.Validate("bar", bar, DefaultValidators.EnumDefinedValidator);
}

or with PIAB

public void Func([EnumDefinedValidator] Bar bar)
{
}