Copies the DictionaryBase elements to a one-dimensional Array at the specified index.
[Visual Basic] Public Overridable Sub CopyTo( _ ByVal array As Array, _ ByVal index As Integer _ ) Implements ICollection.CopyTo [C#] public virtual void CopyTo( Array array, int index ); [C++] public: virtual void CopyTo( Array* array, int index ); [JScript] public function CopyTo( array : Array, index : int );
| Exception Type | Condition |
|---|---|
| ArgumentNullException | array is a null reference (Nothing in Visual Basic). |
| ArgumentOutOfRangeException | index is less than zero. |
| ArgumentException | array is multidimensional.
-or- index is equal to or greater than the length of array. -or- The number of elements in the source DictionaryBase is greater than the available space from index to the end of the destination array. |
| InvalidCastException | The type of the source DictionaryBase cannot be cast automatically to the type of the destination array. |
The elements are copied to the Array in the same order in which the enumerator iterates through the DictionaryBase.
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
DictionaryBase Class | DictionaryBase Members | System.Collections Namespace | System.Array | DictionaryEntry | GetEnumerator