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

定義

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

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

參數

item
TValue

要新增至集合的物件。

實作

例外狀況

在所有情況下。

備註

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

適用於