ReadOnlyDictionary<TKey,TValue>.IDictionary.Add(Object, Object) Method

Definition

Throws a NotSupportedException exception in all cases.

 virtual void System.Collections.IDictionary.Add(System::Object ^ key, System::Object ^ value) = System::Collections::IDictionary::Add;
void IDictionary.Add (object key, object value);
abstract member System.Collections.IDictionary.Add : obj * obj -> unit
override this.System.Collections.IDictionary.Add : obj * obj -> unit
Sub Add (key As Object, value As Object) Implements IDictionary.Add

Parameters

key
Object

The key of the element to add.

value
Object

The value of the element to add.

Implements

Exceptions

In all cases.

Remarks

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

Applies to