StateManagedCollection.OnInsert(Int32, Object) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
當在衍生類別中覆寫時,會在 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.Add 或 IList.Insert 方法加入集合前完成任何額外工作。