Share via


CopyTo Method

Copies all the elements in the DiscountItemCollection to a compatible one-dimensional array starting at the specified index of the target array.

Namespace:  Microsoft.CommerceServer.Runtime.Marketing
Assembly:  Microsoft.CommerceServer.Runtime (in Microsoft.CommerceServer.Runtime.dll)

Syntax

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

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

Parameters

  • array
    Type: array<Microsoft.CommerceServer.Runtime.Marketing..::.DiscountItem>[]()[]
    The one-dimensional Array that is the destination of the elements copied from the current instance. The Array must have zero-based indexing and one-dimensional. Cannot be nullNothingnullptra null reference (Nothing in Visual Basic).
  • index
    Type: System..::.Int32
    The zero-based index in the destination array at which storing begins.

Exceptions

Exception Condition
ArgumentNullException

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

ArgumentOutOfRangeException

index is less than zero.

ArgumentException

array is multidimensional -or- array does not have zero-based indexing -or- index is equal to or greater than the length of array -or- The number of elements in the source list is greater than the available space from index to the end of the destination array.

Remarks

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

Permissions

See Also

Reference

DiscountItemCollection Class

DiscountItemCollection Members

Microsoft.CommerceServer.Runtime.Marketing Namespace