StateManagedCollection.OnInsert(Int32, Object) 方法

定义

在派生类中重写时,在或IList.Insert(Int32, Object)方法向集合中添加项之前IList.Add(Object)执行其他工作。

protected:
 virtual void OnInsert(int index, System::Object ^ value);
protected virtual void OnInsert(int index, object value);
abstract member OnInsert : int * obj -> unit
override this.OnInsert : int * obj -> unit
Protected Overridable Sub OnInsert (index As Integer, value As Object)

参数

index
Int32

方法应插入的 value 从零开始的 IList.Insert(Int32, Object) 索引。

value
Object

要插入到 . 中的 StateManagedCollection对象。

注解

派生自StateManagedCollection的集合可以在使用OnInsertIList.Add方法将项添加到集合之前重写IList.Insert该方法以执行任何其他工作。

适用于

另请参阅