BindingContext.ICollection.CopyTo(Array, Int32) BindingContext.ICollection.CopyTo(Array, Int32) BindingContext.ICollection.CopyTo(Array, Int32) Method

Definición

Copia los elementos de la colección en la matriz especificada, empezando por el índice de la colección.Copies the elements of the collection into a specified array, starting at the collection index.

 virtual void System.Collections.ICollection.CopyTo(Array ^ ar, int index) = System::Collections::ICollection::CopyTo;
void ICollection.CopyTo (Array ar, int index);
Sub CopyTo (ar As Array, index As Integer) Implements ICollection.CopyTo

Parámetros

ar
Array Array Array

Objeto Array en el que se va a copiar.An Array to copy into.

index
Int32 Int32 Int32

Índice de la colección donde se va a empezar a copiar.The collection index to begin copying from.

Implementaciones

Ejemplos

private:
   void CopyToArray()
   {
      // Declare the array.
      array<Object^>^ myArray = gcnew array<Object^>(100);
      ( (ICollection^)(this->BindingContext) )->CopyTo( myArray, 0 );
   }
private void CopyToArray(){
   // Declare the array.
   object [] myArray = new object [100];
   ((ICollection)this.BindingContext).CopyTo(myArray, 0);
}       
Private Sub CopyToArray()
    ' Declare the array.
    Dim myArray(100) As Object
    CType(Me.BindingContext, ICollection).CopyTo(myArray, 0)
End Sub

Se aplica a