SortedList<TKey, TValue>::ICollection<KeyValuePair<TKey, TValue>>::Remove Method (KeyValuePair<TKey, TValue>)
Removes the first occurrence of a specific key/value pair from the ICollection<T>.
Assembly: System (in System.dll)
private: virtual bool Remove( KeyValuePair<TKey, TValue> keyValuePair ) sealed = ICollection<KeyValuePair<TKey, TValue>>::Remove
Parameters
- keyValuePair
-
Type:
System.Collections.Generic::KeyValuePair<TKey, TValue>
The KeyValuePair<TKey, TValue> to remove from the ICollection<T>.
Return Value
Type: System::Booleantrue if keyValuePair was successfully removed from the ICollection<T>; otherwise, false. This method also returns false if keyValuePair was not found in the original ICollection<T>.
Implements
ICollection<T>::Remove(T)This method determines equality using the default comparer Default for KeyValuePair<TKey, TValue>.
This method performs a binary search; however, the elements are moved up to fill in the open spot, so this method is an O(n) operation, where n is Count.
Available since 10
.NET Framework
Available since 2.0