Dictionary<TKey,TValue>.ICollection<KeyValuePair<TKey,TValue>>.Add Méthode

Définition

Ajoute la valeur spécifiée à la ICollection<T> clé spécifiée.

 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

Paramètres

keyValuePair
KeyValuePair<TKey,TValue>

Structure KeyValuePair<TKey,TValue> représentant la clé et la valeur à ajouter au Dictionary<TKey,TValue>.

Implémente

Exceptions

La clé de keyValuePair .null

Un élément avec la même clé existe déjà dans le Dictionary<TKey,TValue>.

S’applique à