System.Collections.ObjectModel.KeyedCollection<TKey,TItem>.RemoveItem Method

Removes the element at the specified index of the System.Collections.ObjectModel.KeyedCollection`2.

Syntax

protected override void RemoveItem (int index)

Parameters

index
The index of the element to remove.

Remarks

The key of the element is also removed from the lookup dictionary.

If the number of elements has exceeded the dictionary creation threshold and the System.Collections.ObjectModel.KeyedCollection`2 is using a lookup dictionary, it will continue to use a lookup dictionary even though the number of elements is again under the threshold.

This method is an O(n) operation, where n is Collection`1.Count.

Notes for Implementers

Override this method to provide customized behavior for the Collection`1.Remove(`0) and Collection`1.RemoveAt(int) methods, inherited from the System.Collections.ObjectModel.Collection`1 generic class, and the KeyedCollection`2.Remove(`0) method.

Call the base class implementation of this method to remove the item from the underlying collection and to update the lookup dictionary.

Requirements

Namespace: System.Collections.ObjectModel
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0