StateManagedCollection.OnRemove(Int32, Object) Method

Definition

When overridden in a derived class, performs additional work before the IList.Remove(Object) or IList.RemoveAt(Int32) method removes the specified item from the collection.

C#
protected virtual void OnRemove(int index, object value);

Parameters

index
Int32

The zero-based index of the item to remove, which is used when IList.RemoveAt(Int32) is called.

value
Object

The object to remove from the StateManagedCollection, which is used when IList.Remove(Object) is called.

Remarks

Collections derived from StateManagedCollection can override the OnRemove method to perform any additional work before an item is removed from the collection using the IList.Remove or IList.RemoveAt method.

Applies to

Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also