Inserts the elements of a collection into the ArrayList at the specified index.
[Visual Basic] Overridable Public Sub InsertRange( _ ByVal index As Integer, _ ByVal c As ICollection _ ) [C#] public virtual void InsertRange( int index, ICollection c ); [C++] public: virtual void InsertRange( int index, ICollection* c ); [JScript] public function InsertRange( index : int, c : ICollection );
None.
Exception Type | Condition |
---|---|
ArgumentNullException | c is a null reference (in Visual Basic Nothing). |
ArgumentOutOfRangeException | index is less than zero.
-or- index is greater than Count. |
NotSupportedException | The ArrayList is read-only.
-or- The ArrayList has a fixed size. |
This method can be overridden by a derived class.
If the new Count (the current Count plus the size of the collection) would be greater than Capacity, the capacity of the list is either doubled or increased to the new count, whichever is greater. The internal array is reallocated to accommodate the new elements.
If index is equal to Count, the elements are added to the end of ArrayList.
The order of the elements in the ICollection is preserved in the ArrayList.
ArrayList Class | ArrayList Members | System.Collections Namespace | Insert | AddRange | SetRange | GetRange | RemoveRange