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>に存在します。

適用対象