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

System.Collections.IList.Insert Method

Inserts an item to the current instance at the specified position. [Edit]

public void Insert (int index, object value)

Parameters

index
A int that specifies the zero-based index at which value is inserted. [Edit]
value
The object to insert into the current instance. [Edit]

Exceptions

TypeReason
ArgumentOutOfRangeExceptionindex is not a valid index in the current instance (i.e. is greater than the number of elements in the current instance). [Edit]
NotSupportedExceptionThe current instance is read-only or has a fixed size. [Edit]

Remarks

Operation
If index equals the number of items in the IList, then value is required to be appended to the end of the current instance.

Usage
Use IList.Insert(int, object) to place a new element into a specific position in the current instance.

[Edit]

Requirements

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