Share via


CopyTo Method

Copies all of the elements in the current instance to a compatible one-dimensional CommerceResourceCollection array, starting at the specified index in the array.

Namespace:  Microsoft.CommerceServer.Runtime.Configuration
Assembly:  Microsoft.CommerceServer.Shared (in Microsoft.CommerceServer.Shared.dll)

Syntax

'Declaration
Public Sub CopyTo ( _
    array As CommerceResource(), _
    index As Integer _
)
'Usage
Dim instance As CommerceResourceCollection
Dim array As CommerceResource()
Dim index As Integer

instance.CopyTo(array, index)
public void CopyTo(
    CommerceResource[] array,
    int index
)
public:
void CopyTo(
    array<CommerceResource^>^ array, 
    int index
)
public function CopyTo(
    array : CommerceResource[], 
    index : int
)

Parameters

  • index
    Type: System..::.Int32
    The zero-based index in the destination array at which storing begins.

Exceptions

Exception Condition
ArgumentException

The array is multidimensional, the index is equal to or greater than the length of array, or the number of elements in the source collection is greater than the available space from index to the end of the destination array.

ArgumentNullException

array is nullNothingnullptra null reference (Nothing in Visual Basic).

ArgumentOutOfRangeException

index is less than zero.

InvalidCastException

The type of the source System.Collections.ICollection cannot be cast automatically to the type of the destination array.

Remarks

The CommerceResource elements are copied to the target array, starting at the specified index of the target array.

Permissions

See Also

Reference

CommerceResourceCollection Class

CommerceResourceCollection Members

Microsoft.CommerceServer.Runtime.Configuration Namespace