語言

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例外。

適用於