ReadOnlyDictionary<TKey,TValue>.KeyCollection.ICollection<TKey>.Add 方法

定義

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

 virtual void System.Collections.Generic.ICollection<TKey>.Add(TKey item) = System::Collections::Generic::ICollection<TKey>::Add;
void ICollection<TKey>.Add (TKey item);
abstract member System.Collections.Generic.ICollection<TKey>.Add : 'Key -> unit
override this.System.Collections.Generic.ICollection<TKey>.Add : 'Key -> unit
Sub Add (item As TKey) Implements ICollection(Of TKey).Add

參數

item
TKey

要新增至集合的物件。

實作

例外狀況

在所有情況下。

備註

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

適用於