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 异常。

适用于