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

System.Collections.ArrayList.Insert Method

Inserts the specified object into the current instance at the specified index.

public virtual void Insert (int index, object value)

Parameters

index
A int that specifies the index in the current instance at which value is inserted. This value is between 0 and the ArrayList.Count of the current instance, inclusive.
value
The object to insert.

Exceptions

TypeReason
ArgumentOutOfRangeException

index < 0.

-or-

index > ArrayList.Count of the current instance.

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

Remarks

Note: This method is implemented to support the IList interface.

Operation
As described above.

If the ArrayList.Count of the current instance is equal to the ArrayList.Capacity of the current instance, the capacity of the list is doubled by automatically reallocating the internal array before the new element is inserted. If index is equal to the ArrayList.Count of the current instance, value is added to the end of the current instance.

Requirements

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