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

Definition

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

Parameters

item
TKey TKey TKey

The object to add to the collection.

Implements

Exceptions

Remarks

This member is an explicit interface member implementation. It can be used only when the ReadOnlyDictionary<TKey,TValue>.KeyCollection instance is cast to an ICollection<T> interface. The ICollection<T> interface specifies that the Add method should throw a NotSupportedException exception if the collection that implements the interface is read-only.

Applies to