다음을 통해 공유


BindingCollection.CopyTo(Binding[], Int32) 메서드

정의

대상 배열의 지정된 인덱스(0부터 시작)에서 시작하여 전체 BindingCollectionBinding 형식의 호환되는 1차원 배열에 복사합니다.

public:
 void CopyTo(cli::array <System::Web::Services::Description::Binding ^> ^ array, int index);
public void CopyTo (System.Web.Services.Description.Binding[] array, int index);
member this.CopyTo : System.Web.Services.Description.Binding[] * int -> unit
Public Sub CopyTo (array As Binding(), index As Integer)

매개 변수

array
Binding[]

복사될 대상인 Binding 형식의 배열입니다.

index
Int32

복사된 컬렉션을 배치하기 시작할 인덱스(0부터 시작)입니다.

예제

array<Binding^>^myBindings = gcnew array<Binding^>(myServiceDescription->Bindings->Count);

// Copy BindingCollection to an Array.
myServiceDescription->Bindings->CopyTo( myBindings, 0 );
Console::WriteLine( "\n\n Displaying array copied from BindingCollection" );
for ( int i = 0; i < myServiceDescription->Bindings->Count; ++i )
{
   Console::WriteLine( "\nBinding {0}", i );
   Console::WriteLine( "\t Name : {0}", myBindings[ i ]->Name );
   Console::WriteLine( "\t Type : {0}", myBindings[ i ]->Type );
}
Binding[] myBindings = new Binding[myServiceDescription.Bindings.Count];
// Copy BindingCollection to an Array.
myServiceDescription.Bindings.CopyTo(myBindings,0);
Console.WriteLine("\n\n Displaying array copied from BindingCollection");
for(int i=0;i < myServiceDescription.Bindings.Count; ++i)
{
   Console.WriteLine("\nBinding " + i );
   Console.WriteLine("\t Name : " + myBindings[i].Name);
   Console.WriteLine("\t Type : " + myBindings[i].Type);
}
Dim myBindings(myServiceDescription.Bindings.Count) As Binding
' Copy BindingCollection to an Array.
myServiceDescription.Bindings.CopyTo(myBindings, 0)
Console.WriteLine(ControlChars.Cr + ControlChars.Cr + " Displaying array copied from BindingCollection")


While i < myServiceDescription.Bindings.Count
   Console.WriteLine((ControlChars.Cr + "Binding " + i))
   Console.WriteLine((ControlChars.Tab + " Name : " + myBindings(i).Name))
   Console.WriteLine((ControlChars.Tab + " Type : " + myBindings(i).Type.ToString()))
End While

적용 대상