Share via


Dictionary<TKey,TValue>.ICollection<KeyValuePair<TKey,TValue>>.Add Metode

Definisi

Menambahkan nilai yang ditentukan ke ICollection<T> dengan kunci yang ditentukan.

 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

Parameter

keyValuePair
KeyValuePair<TKey,TValue>

Struktur KeyValuePair<TKey,TValue> yang mewakili kunci dan nilai untuk ditambahkan ke Dictionary<TKey,TValue>.

Penerapan

Pengecualian

Kuncinya keyValuePair adalah null.

Elemen dengan kunci yang sama sudah ada di Dictionary<TKey,TValue>.

Berlaku untuk