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

정의

컬렉션 인덱스부터 컬렉션의 요소를 지정한 배열에 복사합니다.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

매개 변수

ar
Array Array Array

복사할 대상 Array입니다.An Array to copy into.

index
Int32 Int32 Int32

복사를 시작할 컬렉션 인덱스입니다.The collection index to begin copying from.

구현

예제

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

적용 대상