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

System.Collections.ArrayList.SetRange Method

Copies the elements of the specified ICollection to a range in the current instance.

public virtual void SetRange (int index, ICollection c)

Parameters

index
A int that specifies the zero-based index in the current instance at which to start copying the elements of c. This value is between 0 and the ArrayList.Count of the current instance minus c.Count, inclusive.
c
The ICollection whose elements to copy to the current instance.

Exceptions

TypeReason
ArgumentOutOfRangeException

index < 0.

-or-

ArrayList.Count of the current instance - index < c.Count.

ArgumentNullExceptionc is null.
NotSupportedExceptionThe current instance is read-only.

Remarks

Operation
As described above.

This method uses the ICollection.CopyTo(Array, int) implementation of ICollectionc.

Requirements

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