Mono Class Library: System.Collections.Generic.IList<T> Overview | Members

System.Collections.Generic.IList<T>.Insert Method

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

public void Insert (int index, T item)

Parameters

index
A stem.Int32 that specifies the zero-based index at which value is inserted. [Edit]
item
Documentation for this section has not yet been entered. [Edit]

Exceptions

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

Remarks

In collections of contiguous elements, such as lists, the elements that follow the insertion point have indices one more than previously, to accommodate the new element. If the collection is indexed, the indexes of the elements that are moved are also updated.

Operation

If index equals the number of items in the stem.Collections.Generic.IList<T>, then value is required to be appended to the end of the current instance.

[Edit]

Requirements

Namespace: System.Collections.Generic
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0