Dictionary<TKey,TValue>.ICollection<KeyValuePair<TKey,TValue>>.Add(KeyValuePair<TKey,TValue>) Yöntem

Tanım

Belirtilen anahtarı içeren öğesine belirtilen değeri ekler ICollection<T> .Adds the specified value to the ICollection<T> with the specified key.

 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

Parametreler

keyValuePair
KeyValuePair<TKey,TValue>

KeyValuePair<TKey,TValue>Öğesine eklenecek anahtarı ve değeri temsil eden yapı Dictionary<TKey,TValue> .The KeyValuePair<TKey,TValue> structure representing the key and value to add to the Dictionary<TKey,TValue>.

Uygulamalar

Özel durumlar

, Öğesinin anahtarıdır keyValuePair null .The key of keyValuePair is null.

İçinde aynı anahtara sahip bir öğe zaten var Dictionary<TKey,TValue> .An element with the same key already exists in the Dictionary<TKey,TValue>.

Şunlara uygulanır