AnalysisAlternateCollection.CopyTo Method
Copies all of the elements of the current AnalysisAlternateCollection to a one-dimensional array, starting at a specified destination array index.
Namespace: System.Windows.Ink
Assembly: IAWinFX (in iawinfx.dll)
Syntax
'Declaration
Public Sub CopyTo ( _
alternates As AnalysisAlternate(), _
index As Integer _
)
'Usage
Dim instance As AnalysisAlternateCollection
Dim alternates As AnalysisAlternate()
Dim index As Integer
instance.CopyTo(alternates, index)
public void CopyTo (
AnalysisAlternate[] alternates,
int index
)
public:
void CopyTo (
array<AnalysisAlternate^>^ alternates,
int index
)
public void CopyTo (
AnalysisAlternate[] alternates,
int index
)
public function CopyTo (
alternates : AnalysisAlternate[],
index : int
)
Not applicable.
Parameters
- alternates
The one-dimensional array that is the destination of elements copied from the collection. The array must have zero-based indexing.
- index
The zero-based index in the array parameter at which copying begins.
Remarks
The elements are copied to the Array object in the same order in which the enumerator iterates through the AnalysisAlternateCollection.
An exception is thrown if:
The array parameter is a a null reference (Nothing in Visual Basic) reference.
The index parameter is less than zero.
The array parameter is multidimensional.
The index parameter is equal to or greater than the length of the array parameter.
The number of elements in the collection is higher than the available space from the index parameter to the end of the destination array parameter.
The type of the collection is cast automatically to the type of the destination array parameter. This method copies elements to arrays only of the type, AnalysisAlternate or Object. Attempting to copy to another type of array causes an InvalidCastException exception to be thrown.
Example
This example fills part of an array of AnalysisAlternate objects with an AnalysisAlternateCollection named alternates
. The array starts at index 1 (the second element in a zero-based array) of the destination array, alternateArray,
and leaves the first element of the destination array (with an index of 0) empty.
Dim alternateArray(alternates.Count + 1) As AnalysisAlternate
alternates.CopyTo(alternateArray, 1)
AnalysisAlternate[] alternateArray = new AnalysisAlternate[alternates.Count + 1];
alternates.CopyTo(alternateArray, 1);
Platforms
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.
Version Information
.NET Framework
Supported in: 3.0
See Also
Reference
AnalysisAlternateCollection Class
AnalysisAlternateCollection Members
System.Windows.Ink Namespace