Dictionary<TKey,TValue>.ICollection<KeyValuePair<TKey,TValue>>.Add Метод

Определение

Добавляет указанное значение в 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);
abstract member System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.Add : System.Collections.Generic.KeyValuePair<'Key, 'Value> -> unit
override this.System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.Add : System.Collections.Generic.KeyValuePair<'Key, 'Value> -> unit
Sub Add (keyValuePair As KeyValuePair(Of TKey, TValue)) Implements ICollection(Of KeyValuePair(Of TKey, TValue)).Add

Параметры

keyValuePair
KeyValuePair<TKey,TValue>

Структура KeyValuePair<TKey,TValue> , представляющая ключ и значение, добавляемое в Dictionary<TKey,TValue>.

Реализации

Исключения

Ключом keyValuePair является null.

Элемент с тем же ключом уже существует в элементе Dictionary<TKey,TValue>.

Применяется к