Export (0) Print
Expand All

CallbackValidator Class

Provides dynamic validation of an object.

Namespace:  System.Configuration
Assembly:  System.Configuration (in System.Configuration.dll)

public ref class CallbackValidator sealed : public ConfigurationValidatorBase

The CallbackValidator type exposes the following members.

Public methodCallbackValidatorInitializes a new instance of the CallbackValidator class.

Public methodCanValidateDetermines whether the type of the object can be validated. (Overrides ConfigurationValidatorBase::CanValidate(Type).)
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Public methodValidateDetermines whether the value of an object is valid. (Overrides ConfigurationValidatorBase::Validate(Object).)

To use this class, you need to implement a ValidatorCallback delegate for the type of object you want to validate. When you instantiate this class, you pass in the object type and a reference to the delegate. You can then call CanValidate to determine if an object is the correct type or Validate to execute the delegate on the object.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
© 2015 Microsoft