StateManagedCollection.OnValidate(Object) 方法
定义
在派生类中替代时,验证 StateManagedCollection 集合的一个元素。When overridden in a derived class, validates an element of the StateManagedCollection collection.
protected:
virtual void OnValidate(System::Object ^ value);
protected virtual void OnValidate (object value);
abstract member OnValidate : obj -> unit
override this.OnValidate : obj -> unit
Protected Overridable Sub OnValidate (value As Object)
参数
- value
- Object
要验证的 IStateManager。The IStateManager to validate.
例外
value 为 null。value is null.
注解
OnValidate调用方法来验证通过 StateManagedCollection 实现接口方法操作的对象 IList 。The OnValidate method is called to validate the object manipulated through the StateManagedCollection implementation of the IList interface methods. 默认实现是验证集合操作的对象是否不是 null ; 但是,从派生的集合 StateManagedCollection 重写 OnValidate 方法以执行任何其他验证,如类型检查。The default implementation is to verify that the object manipulated by the collection is not null; however, collections derived from StateManagedCollection override the OnValidate method to perform any additional validation, such as type-checking.