ImmutableSortedDictionary<TKey,TValue>.IDictionary<TKey,TValue>.Add 方法

定義

將具有所提供索引鍵和值的項目新增至泛型字典。

 virtual void System.Collections.Generic.IDictionary<TKey,TValue>.Add(TKey key, TValue value) = System::Collections::Generic::IDictionary<TKey, TValue>::Add;
void IDictionary<TKey,TValue>.Add (TKey key, TValue value);
abstract member System.Collections.Generic.IDictionary<TKey,TValue>.Add : 'Key * 'Value -> unit
override this.System.Collections.Generic.IDictionary<TKey,TValue>.Add : 'Key * 'Value -> unit
Sub Add (key As TKey, value As TValue) Implements IDictionary(Of TKey, TValue).Add

參數

key
TKey

做為要加入項目之索引鍵的物件。

value
TValue

做為要加入項目之值的物件。

實作

例外狀況

keynull

IDictionary<TKey,TValue> 中已存在具有相同索引鍵的元素。

適用於