ValidationState Enumeration

 

Identifies whether instances of a class will be enabled for validation.

Namespace:   Microsoft.VisualStudio.Modeling.Validation
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.12.0 (in Microsoft.VisualStudio.Modeling.Sdk.12.0.dll)

public enum class ValidationState

Member nameDescription
Disabled

Indicates that instances of the class to which this value is applied will not be checked by validation methods for this class.

Enabled

Indicates that instances of the class to which this value is applied will be enabled for validation.

Inherited

Indicates that instances of the class to which this value is applied will be enabled or disabled for validation based on the settings for their parent class.

This enumeration is used as the argument to the class attribute ValidationStateAttribute.

You can apply the ValidationState.Disabled setting to a derived class whose parent is enabled for validation because derived classes have the ValidationState of their parent class by default.

For more information about validation, see Validation in a Domain-Specific Language.

The following example shows the ValidationState attribute using the ValidationState enumeration to enable validation to occur on the Person class.

[C#]

[ValidationState(ValidationState.Enabled)]
public partial class Person
{
    //Code goes here...
}
Return to top
Show: