OrderedDictionary<TKey,TValue>.Add(TKey, TValue) 方法

定義

將具有所提供索引鍵和值的專案加入至 IDictionary<TKey,TValue>

public:
 virtual void Add(TKey key, TValue value);
public void Add (TKey key, TValue value);
abstract member Add : 'Key * 'Value -> unit
override this.Add : 'Key * 'Value -> unit
Public Sub Add (key As TKey, value As TValue)

參數

key
TKey

要做為要加入之專案索引鍵的物件。

value
TValue

要當做要加入之專案值的物件。

實作

例外狀況

索引鍵 null

具有相同索引鍵的專案已存在於 OrderedDictionary<TKey,TValue>中。

適用於