BindingCollection.CopyTo(Binding[], Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Copies the entire BindingCollection to a compatible one-dimensional array of type Binding, starting at the specified zero-based index of the target array.
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)
Parameters
- index
- Int32
The zero-based index at which to start placing the copied collection.
Examples
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
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET