Adds the elements of an ICollection to the end of the ArrayList.
[Visual Basic] Overridable Public Sub AddRange( _ ByVal c As ICollection _ ) [C#] public virtual void AddRange( ICollection c ); [C++] public: virtual void AddRange( ICollection* c ); [JScript] public function AddRange( c : ICollection );
None.
Exception Type | Condition |
---|---|
ArgumentException | c is a null reference (in Visual Basic Nothing). |
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.
ArrayList Class | ArrayList Members | System.Collections Namespace | ICollection | Capacity | Count | Add | InsertRange | SetRange | GetRange | RemoveRange