StateManagedCollection.OnInsert(Int32, Object) 方法

定義

當在衍生類別中覆寫時,會在 or 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 集合的集合可以覆寫方法 OnInsert ,在使用 IList.AddIList.Insert 方法加入集合前完成任何額外工作。

適用於

另請參閱