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

IList.Insert(Int32, Object) 方法應該插入 value 處之以零為起始的索引。

value
Object

要插入 StateManagedCollection 的物件。

備註

衍生自 StateManagedCollectionOnInsert 集合可以覆寫 方法來執行任何其他工作,再使用 IList.AddIList.Insert 方法將專案新增至集合。

適用於

另請參閱