OperationBindingCollection.CopyTo(OperationBinding[], 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 OperationBindingCollection
to a compatible one-dimensional array of type OperationBinding, starting at the specified zero-based index of the target array.
public:
void CopyTo(cli::array <System::Web::Services::Description::OperationBinding ^> ^ array, int index);
public void CopyTo (System.Web.Services.Description.OperationBinding[] array, int index);
member this.CopyTo : System.Web.Services.Description.OperationBinding[] * int -> unit
Public Sub CopyTo (array As OperationBinding(), index As Integer)
Parameters
- array
- OperationBinding[]
An array of type OperationBinding serving as the destination for the copy action.
- index
- Int32
The zero-based index at which to start placing the copied collection.
Examples
The following example demonstrates the use of the CopyTo
method.
array<OperationBinding^>^operationBindingArray =
gcnew array<OperationBinding^>(myOperationBindingCollection->Count);
// Copy this collection to the OperationBinding array.
myOperationBindingCollection->CopyTo( operationBindingArray, 0 );
Console::WriteLine( "The operations supported by this service "
"are :" );
for each(OperationBinding^ myOperationBinding1 in operationBindingArray)
{
Binding^ myBinding = myOperationBinding1->Binding;
Console::WriteLine(" Binding : "+ myBinding->Name + " Name of " +
"operation : " + myOperationBinding1->Name);
}
OperationBinding[] operationBindingArray = new
OperationBinding[myOperationBindingCollection.Count];
// Copy this collection to the OperationBinding array.
myOperationBindingCollection.CopyTo(operationBindingArray, 0);
Console.WriteLine("The operations supported by this service " +
"are :");
foreach(OperationBinding myOperationBinding1 in
operationBindingArray)
{
Binding myBinding = myOperationBinding1.Binding;
Console.WriteLine(" Binding : "+ myBinding.Name + " Name of " +
"operation : " + myOperationBinding1.Name);
}
Dim operationBindingArray(myOperationBindingCollection.Count -1 ) _
As OperationBinding
' Copy this collection to the OperationBinding array.
myOperationBindingCollection.CopyTo(operationBindingArray, 0)
Console.WriteLine("The operations supported by this service " & _
"are :")
Dim myOperationBinding1 As OperationBinding
For Each myOperationBinding1 In operationBindingArray
Dim myBinding As Binding = myOperationBinding1.Binding
Console.WriteLine(" Binding : " & myBinding.Name & " Name of " & _
"operation : " & myOperationBinding1.Name)
Next myOperationBinding1
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET