ReadOnlyDictionary<TKey,TValue>.IDictionary.Add(Object, Object) 方法

定義

在所有情況下都會擲回 NotSupportedException 例外狀況。

 virtual void System.Collections.IDictionary.Add(System::Object ^ key, System::Object ^ value) = System::Collections::IDictionary::Add;
void IDictionary.Add (object key, object value);
abstract member System.Collections.IDictionary.Add : obj * obj -> unit
override this.System.Collections.IDictionary.Add : obj * obj -> unit
Sub Add (key As Object, value As Object) Implements IDictionary.Add

參數

key
Object

要加入的項目的索引鍵。

value
Object

要加入的項目的值。

實作

例外狀況

在所有情況下。

備註

這個成員是明確介面成員實作, 只有在 ReadOnlyDictionary<TKey,TValue> 執行個體轉換成 IDictionary 介面時,才能使用這個成員。 如果 IDictionary 實作介面的集合是只讀的,介面會 Add 指定 方法應該擲回 NotSupportedException 例外狀況。

適用於