OperationCollection::CopyTo Method (array<Operation^>^, Int32)

 

Copies the entire OperationCollection to a compatible one-dimensional array of type Operation, starting at the specified zero-based index of the target array.

Namespace:   System.Web.Services.Description
Assembly:  System.Web.Services (in System.Web.Services.dll)

public:
void CopyTo(
	array<Operation^>^ array,
	int index
)

Parameters

array
Type: array<System.Web.Services.Description::Operation^>^

An array of type Operation serving as the destination for the copy action.

index
Type: System::Int32

The zero-based index at which to start placing the copied collection.

The following example demonstrates the use of the CopyTo method.

array<Operation^>^myOperationArray = gcnew array<Operation^>(myOperationCollection->Count);
myOperationCollection->CopyTo( myOperationArray, 0 );
Console::WriteLine( "The operation(s) in the collection are :" );
for ( int i = 0; i < myOperationCollection->Count; i++ )
{
   Console::WriteLine( " {0}", myOperationArray[ i ]->Name );
}

.NET Framework
Available since 1.1
Return to top
Show: