ImportCollection::CopyTo Method (array<Import^>^, Int32)

 

Copies the entire ImportCollection to a compatible one-dimensional array of type Import, 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<Import^>^ array,
	int index
)

Parameters

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

An array of type Import serving as the destination of 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<Import^>^myImports = gcnew array<Import^>(myServiceDescription->Imports->Count);

// Copy 'ImportCollection' to an array.
myServiceDescription->Imports->CopyTo( myImports, 0 );
Console::WriteLine( "Imports that are copied to Importarray ..." );
for ( int i = 0; i < myImports->Length; ++i )
   Console::WriteLine( "\tImport Namespace : {0} Import Location : {1} ",
      myImports[ i ]->Namespace, myImports[ i ]->Location );

.NET Framework
Available since 1.1
Return to top
Show: