ReadOnlyDictionary<TKey,TValue>.KeyCollection.CopyTo(TKey[], Int32) Método
Definição
Copia os elementos da coleção para uma matriz, começando em um índice de matriz específico.Copies the elements of the collection to an array, starting at a specific array index.
public:
virtual void CopyTo(cli::array <TKey> ^ array, int arrayIndex);
public void CopyTo (TKey[] array, int arrayIndex);
abstract member CopyTo : 'Key[] * int -> unit
override this.CopyTo : 'Key[] * int -> unit
Public Sub CopyTo (array As TKey(), arrayIndex As Integer)
Parâmetros
- array
- TKey[]
A matriz unidimensional que é o destino dos elementos copiados da coleção.The one-dimensional array that is the destination of the elements copied from the collection. A matriz deve ter indexação com base em zero.The array must have zero-based indexing.
- arrayIndex
- Int32
O índice com base em zero em array no qual a cópia começa.The zero-based index in array at which copying begins.
Implementações
Exceções
array é null.array is null.
arrayIndex é menor que 0.arrayIndex is less than 0.
array é multidimensional.array is multidimensional.
- ou --or-
O número de elementos na coleção de origem é maior do que o espaço disponível do arrayIndex até o final do array de destino.The number of elements in the source collection is greater than the available space from arrayIndex to the end of the destination array.
- ou --or-
O tipo T não pode ser convertido automaticamente no tipo de destino array.Type T cannot be cast automatically to the type of the destination array.