SortedDictionary<TKey,TValue>.ICollection<KeyValuePair<TKey,TValue>>.Add(KeyValuePair<TKey,TValue>) Method

Definition

Adds an item to the ICollection<T>.

 virtual void System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.Add(System::Collections::Generic::KeyValuePair<TKey, TValue> keyValuePair) = System::Collections::Generic::ICollection<System::Collections::Generic::KeyValuePair<TKey, TValue>>::Add;
void ICollection<KeyValuePair<TKey,TValue>>.Add (System.Collections.Generic.KeyValuePair<TKey,TValue> keyValuePair);
Sub Add (keyValuePair As KeyValuePair(Of TKey, TValue)) Implements ICollection(Of KeyValuePair(Of TKey, TValue)).Add

Parameters

keyValuePair
KeyValuePair<TKey,TValue>

The KeyValuePair<TKey,TValue> structure to add to the ICollection<T>.

Implements

Exceptions

keyValuePair is null.

An element with the same key already exists in the SortedDictionary<TKey,TValue>.

Applies to