CollectionBase<T>.CopyTo Method

Copies the internal collection to the specified array, starting at the specified index.

Namespace:  Microsoft.SharePoint.Publishing
Assembly:  Microsoft.SharePoint.Publishing (in Microsoft.SharePoint.Publishing.dll)

Syntax

'Declaration
<SharePointPermissionAttribute(SecurityAction.Demand, ObjectModel := True)> _
Public Sub CopyTo ( _
    array As Array, _
    index As Integer _
)
'Usage
Dim instance As CollectionBase
Dim array As Array
Dim index As Integer

instance.CopyTo(array, index)
[SharePointPermissionAttribute(SecurityAction.Demand, ObjectModel = true)]
public void CopyTo(
    Array array,
    int index
)

Parameters

  • array
    Type: System.Array

    One-dimensional array that is the destination of the elements copied from the ICollection interface. The array must have zero-based indexing.

  • index
    Type: System.Int32

    Index in the array at which copying begins.

Implements

ICollection.CopyTo(Array, Int32)

Exceptions

Exception Condition
ArgumentException

The array is not large enough to hold copied data. The number of elements in the source ICollection interface is greater than the available space from the index to the end of the destination array

ArgumentNullException

Occurs if array is a null reference (Nothing in Visual Basic).

ArgumentOutOfRangeException

Occurs if the index is less than zero.

See Also

Reference

CollectionBase<T> Class

CollectionBase<T> Members

Microsoft.SharePoint.Publishing Namespace

CollectionBase<T>