SortedDictionary<'TKey, 'TValue>.ICollection<KeyValuePair<'TKey, 'TValue>>.Add Method (KeyValuePair<'TKey, 'TValue>)
Adds an item to the ICollection<'T>.
Assembly: System (in System.dll)
private abstract Add : keyValuePair:KeyValuePair<'TKey, 'TValue> -> unit private override Add : keyValuePair:KeyValuePair<'TKey, 'TValue> -> unit
Parameters
- keyValuePair
-
Type:
System.Collections.Generic.KeyValuePair<'TKey, 'TValue>
The KeyValuePair<'TKey, 'TValue> structure to add to the ICollection<'T>.
Implements
ICollection<'T>.Add('T)| Exception | Condition |
|---|---|
| ArgumentNullException | keyValuePair is null. |
| ArgumentException | An element with the same key already exists in the SortedDictionary<'TKey, 'TValue>. |
A key cannot be null, but a value can be, if the value type TValue is a reference type.
This method is an O(log n) operation, where n is Count.
Universal Windows Platform
Available since 8
.NET Framework
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Windows Phone Silverlight
Available since 8.0
Windows Phone
Available since 8.1
Available since 8
.NET Framework
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Windows Phone Silverlight
Available since 8.0
Windows Phone
Available since 8.1
Show: