Mono Class Library: System.Collections.IDictionary Overview | Members

System.Collections.IDictionary.Add Method

Adds an entry with the provided key and value to the current instance. [Edit]

public void Add (object key, object value)

Parameters

key
The object to use as the key of the entry to add. [Edit]
value
The object to use as the value of the entry to add. [Edit]

Exceptions

TypeReason
ArgumentNullExceptionkey is null. [Edit]
ArgumentException An entry with the same key already exists in the current instance. [Edit]
NotSupportedExceptionThe current instance is read-only or has a fixed size. [Edit]

Remarks

If the specified key already exists in the current instance, this method throws a ArgumentException exception but does not modify the associated value.

Operation
As described above.

[Edit]

Requirements

Namespace: System.Collections
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0