ParameterCollection.OnValidate(Object) 方法

定义

当验证值时执行其他自定义进程。Performs additional custom processes when validating a value.

protected:
 override void OnValidate(System::Object ^ o);
protected override void OnValidate (object o);
override this.OnValidate : obj -> unit
Protected Overrides Sub OnValidate (o As Object)

参数

o
Object

正被验证的 objectThe object being validated.

例外

对象不是 Parameter 类或其派生类的实例。The object is not an instance of the Parameter class or one of its derived classes.

对象为 nullThe object is null.

注解

OnValidate方法确定参数中指定的对象是否 oParameter 实例。The OnValidate method determines whether the object specified in the o parameter is a Parameter instance. 如果不是,则会引发 ArgumentException 异常。If not, it throws an ArgumentException exception.

适用于