System.Collections.IList.Add Method

Adds an item to the IList.

Syntax

public int Add (object value)

Parameters

value
The object to add to the IList.

Returns

The position into which the new element was inserted, or -1 to indicate that the item was not inserted into the collection.

Exceptions

TypeReason
NotSupportedExceptionThe current instance is read-only or has a fixed size.

Remarks

Operation
As described above.

Usage
Use the IList.Add(object) method to add another element to the current instance. The index into which that element is added is implementation-dependent.

Requirements

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