ReadOnlyDictionary<TKey,TValue>.KeyCollection.ICollection<TKey>.Add(TKey) ReadOnlyDictionary<TKey,TValue>.KeyCollection.ICollection<TKey>.Add(TKey) ReadOnlyDictionary<TKey,TValue>.KeyCollection.ICollection<TKey>.Add(TKey) Method

定义

任何情况下均引发 NotSupportedException 异常。Throws a NotSupportedException exception in all cases.

 virtual void System.Collections.Generic.ICollection<TKey>.Add(TKey item) = System::Collections::Generic::ICollection<TKey>::Add;
void ICollection<TKey>.Add (TKey item);
Sub Add (item As TKey) Implements ICollection(Of TKey).Add

参数

item
TKey TKey TKey

要添加到集合中的对象。The object to add to the collection.

实现

异常

注解

此成员是显式接口成员的实现。This member is an explicit interface member implementation. 它只能在 ReadOnlyDictionary<TKey,TValue>.KeyCollection 实例被强制转换为 ICollection<T> 接口时使用。It can be used only when the ReadOnlyDictionary<TKey,TValue>.KeyCollection instance is cast to an ICollection<T> interface. 接口指定在Add实现接口的集合为只读NotSupportedException时, 方法应引发异常。 ICollection<T>The ICollection<T> interface specifies that the Add method should throw a NotSupportedException exception if the collection that implements the interface is read-only.

适用于