Share via


ValidationProvider Class

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Provides a mechanism to specify automatic or user requested validation for controls.

Namespace:  Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WinForms
Assembly:  Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WinForms (in Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WinForms.dll)

Syntax

'Declaration
<ToolboxBitmapAttribute(GetType(ValidationProvider))> _
PublicClassValidationProvider _
    Inherits Component _
    Implements IExtenderProvider
[ToolboxBitmapAttribute(typeof(ValidationProvider))]
publicclassValidationProvider : Component, 
    IExtenderProvider
[ToolboxBitmapAttribute(typeof(ValidationProvider))]
publicref classValidationProvider : public Component, 
    IExtenderProvider
publicclass ValidationProvider extends Component implements IExtenderProvider

Remarks

This component is an extender provider that adds properties to controls that allow the designer of the application to specify how to validate the controls' values using the Validation Application Block.

Validation can be automatic through the Validating event, or initiated via code by invoking the PerformValidation(Control) method; in both cases the control needs to have been properly configured through the validation provider.

An instance of ErrorProvider can be specified for the component; in this case the validation errors resulting from validating a control are set on the error provider as a properly formatted error message for the control.

A validation provider can be enabled or disabled through the Enabled property. When it is disabled no validation will occur and the validaton provider will be considered valid, and any error messages posted to the ErrorProvider will be cleared. If re-enabled, it will continue to be valid and no error messages will be posted until validation is triggered again.

Inheritance Hierarchy

System.Object
  System.MarshalByRefObject
    System.ComponentModel.Component
      Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WinForms.ValidationProvider

See Also

ValidationProvider Members

Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WinForms Namespace

ValidationProvider.IsValid

ValidationProvider.Enabled

ValidationProvider.PerformValidation(Control)

Microsoft.Practices.EnterpriseLibrary.Validation.Validator

Microsoft.Practices.EnterpriseLibrary.Validation.ValidationResults

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.