CallbackValidator 类

定义

提供对对象的动态验证。Provides dynamic validation of an object.

public ref class CallbackValidator sealed : System::Configuration::ConfigurationValidatorBase
public sealed class CallbackValidator : System.Configuration.ConfigurationValidatorBase
type CallbackValidator = class
    inherit ConfigurationValidatorBase
Public NotInheritable Class CallbackValidator
Inherits ConfigurationValidatorBase
继承

注解

若要使用此类,需要为 ValidatorCallback 要验证的对象的类型实现一个委托。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. 然后,可以调用 CanValidate 来确定对象是否为正确的类型或 Validate 对对象执行委托。You can then call CanValidate to determine if an object is the correct type or Validate to execute the delegate on the object.

构造函数

CallbackValidator(Type, ValidatorCallback)

初始化 CallbackValidator 类的新实例。Initializes a new instance of the CallbackValidator class.

方法

CanValidate(Type)

确定是否可以验证该对象的类型。Determines whether the type of the object can be validated.

Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)
Validate(Object)

确定对象的值是否有效。Determines whether the value of an object is valid.

适用于