StateManagedCollection.OnInsert(Int32, Object) 方法

定義

在衍生類別中覆寫時,在 IList.Insert(Int32, Object)IList.Add(Object) 方法將項目加入集合之前,執行額外工作。When overridden in a derived class, performs additional work before the IList.Insert(Int32, Object) or IList.Add(Object) method adds an item to the collection.

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

IList.Insert(Int32, Object) 方法應該插入 value 處之以零為起始的索引。The zero-based index at which value should be inserted by the IList.Insert(Int32, Object) method.

value
Object

要插入 StateManagedCollection 的物件。The object to insert into the StateManagedCollection.

備註

衍生自的集合 StateManagedCollection 可以覆寫 OnInsert 方法,以在使用或方法將專案加入至集合之前執行任何額外的工作 IList.Add IList.InsertCollections derived from StateManagedCollection can override the OnInsert method to perform any additional work before an item is added to the collection using the IList.Add or IList.Insert method.

適用於

另請參閱