SortedDictionary<TKey, TValue>.ICollection<KeyValuePair<TKey, TValue>>.Remove Method
Removes the first occurrence of the specified element from the ICollection<T>.
Namespace: System.Collections.Generic
Assembly: System (in System.dll)
Syntax
'Declaration
Private Function Remove ( _
keyValuePair As KeyValuePair(Of TKey, TValue) _
) As Boolean Implements ICollection(Of KeyValuePair(Of TKey, TValue)).Remove
'Usage
Dim instance As SortedDictionary
Dim keyValuePair As KeyValuePair(Of TKey, TValue)
Dim returnValue As Boolean
returnValue = CType(instance, ICollection(Of KeyValuePair(Of TKey, TValue))).Remove(keyValuePair)
bool ICollection<KeyValuePair<TKey, TValue>>.Remove(
KeyValuePair<TKey, TValue> keyValuePair
)
private:
virtual bool Remove(
KeyValuePair<TKey, TValue> keyValuePair
) sealed = ICollection<KeyValuePair<TKey, TValue>>::Remove
J# supports the use of explicit interface implementations, but not the declaration of new ones.
JScript does not support explicit interface implementations.
Parameters
keyValuePair
Type: System.Collections.Generic.KeyValuePair<TKey, TValue>The KeyValuePair<TKey, TValue> structure to remove from the ICollection<T>.
Return Value
Type: System.Boolean
true if keyValuePair was successfully removed from the ICollection<T>; otherwise, false. This method also returns false if keyValuePair was not found in the ICollection<T>.
Implements
Remarks
This method determines equality by first using the Comparer property for the key and then using EqualityComparer<T>.Default for the value.
This method is an O(log n) operation.
Platforms
Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information
.NET Framework
Supported in: 3.5, 3.0 SP1, 3.0, 2.0 SP1, 2.0
See Also
Reference
SortedDictionary<TKey, TValue> Class
SortedDictionary<TKey, TValue> Members