ArrangedElementCollection.CopyTo(Array, Int32) Metoda
Definicja
public:
virtual void CopyTo(Array ^ array, int index);
public void CopyTo (Array array, int index);
abstract member CopyTo : Array * int -> unit
override this.CopyTo : Array * int -> unit
Public Sub CopyTo (array As Array, index As Integer)
Parametry
- array
- Array
Jednowymiarowy Array , który jest miejscem docelowym elementów skopiowanych z bieżącej kolekcji.The one-dimensional Array that is the destination of the elements copied from the current collection. Indeksowanie tablicy musi rozpoczynać się od zera.The array must have zero-based indexing.
- index
- Int32
Numerowany od zera indeks w tablicy array
, od którego rozpoczyna się kopiowanie.The zero-based index in array
at which copying begins.
Implementuje
Wyjątki
array
to null
.array
is null
.
index
jest mniejsza niż 0.index
is less than 0.
Parametr array
jest wielowymiarowy.array
is multidimensional.
-lub--or-
Liczba elementów w kolekcji źródłowej jest większa niż ilość dostępnego miejsca od index
do końca array
.The number of elements in the source collection is greater than the available space from index
to the end of array
.
Nie można automatycznie rzutować typu elementu źródłowego na typ array
.The type of the source element cannot be cast automatically to the type of array
.
Uwagi
Typ określonej tablicy musi być zgodny z kolekcją źródłową.The type of the specified array must be compatible with the source collection.
Ta metoda używa Array.Copy metody do kopiowania elementów.This method uses the Array.Copy method to copy the elements.