StateManagedCollection.OnRemove(Int32, Object) 方法

定義

在衍生類別中覆寫時,在 IList.Remove(Object)IList.RemoveAt(Int32) 方法從集合中移除指定的項目之前,執行額外工作。

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

參數

index
Int32

要移除之項目的以零為起始的索引,在呼叫 IList.RemoveAt(Int32) 時會使用這個索引。

value
Object

要從 StateManagedCollection 移除的物件,在呼叫 IList.Remove(Object) 時會使用這個物件。

備註

衍生自 StateManagedCollectionOnRemove 集合可以覆寫 方法,在使用 或 IList.RemoveAt 方法從集合 IList.Remove 中移除專案之前,先執行任何其他工作。

適用於

另請參閱