CodeTypeDeclarationCollection.CopyTo Method
.NET Framework 1.1
Copies the collection objects to a one-dimensional Array instance beginning at the specified index.
[Visual Basic] Public Sub CopyTo( _ ByVal array() As CodeTypeDeclaration, _ ByVal index As Integer _ ) [C#] public void CopyTo( CodeTypeDeclaration[] array, int index ); [C++] public: void CopyTo( CodeTypeDeclaration* array[], int index ); [JScript] public function CopyTo( array : CodeTypeDeclaration[], index : int );
Parameters
- array
- The one-dimensional Array that is the destination of the values copied from the collection.
- index
- The index of the array at which to begin inserting.
Exceptions
| Exception Type | Condition |
|---|---|
| ArgumentException | The destination array is multidimensional.
-or- The number of elements in the CodeTypeDeclarationCollection is greater than the available space between the index of the target array specified by the index parameter and the end of the target array. |
| ArgumentNullException | The array parameter is a null reference (Nothing in Visual Basic). |
| ArgumentOutOfRangeException | The index parameter is less than the target array's minimum index. |
Example
[Visual Basic] ' Copies the contents of the collection, beginning at index 0, ' to the specified CodeTypeDeclaration array. ' 'declarations' is a CodeTypeDeclaration array. collection.CopyTo(declarations, 0) [C#] // Copies the contents of the collection, beginning at index 0, // to the specified CodeTypeDeclaration array. // 'declarations' is a CodeTypeDeclaration array. collection.CopyTo( declarations, 0 ); [C++] // Copies the contents of the collection, beginning at index 0, // to the specified CodeTypeDeclaration array. // 'declarations' is a CodeTypeDeclaration array. collection->CopyTo( declarations, 0 );
[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button
in the upper-left corner of the page.
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also
CodeTypeDeclarationCollection Class | CodeTypeDeclarationCollection Members | System.CodeDom Namespace | Array