ReadOnlyDictionary<TKey,TValue>.ValueCollection.ICollection<TValue>.Add(TValue) 方法
定义
在所有情况下都会引发 NotSupportedException 异常。Throws a NotSupportedException exception in all cases.
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
要添加到集合中的对象。The object to add to the collection.
实现
例外
在所有情况下。In all cases.
注解
此成员是显式接口成员的实现。This member is an explicit interface member implementation. 它只能在 ReadOnlyDictionary<TKey,TValue>.ValueCollection 实例被强制转换为 ICollection<T> 接口时使用。It can be used only when the ReadOnlyDictionary<TKey,TValue>.ValueCollection instance is cast to an ICollection<T> interface. ICollection<T>接口指定在 Add 实现接口的集合为只读时,方法应引发 NotSupportedException 异常。The ICollection<T> interface specifies that the Add method should throw a NotSupportedException exception if the collection that implements the interface is read-only.