PortTypeCollection::CopyTo Method (array<PortType^>^, Int32)
.NET Framework (current version)
Copies the entire PortTypeCollection to a one-dimensional array of type PortType, starting at the specified zero-based index of the target array.
Assembly: System.Web.Services (in System.Web.Services.dll)
Parameters
- array
-
Type:
array<System.Web.Services.Description::PortType^>^
An array of type PortType serving as the destination for the copy action.
- index
-
Type:
System::Int32
The zero-based index at which to start placing the copied collection.
PortTypeCollection^ myPortTypeCollection; ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MathService_CS.wsdl" ); myPortTypeCollection = myServiceDescription->PortTypes; int noOfPortTypes = myServiceDescription->PortTypes->Count; Console::WriteLine( "\nTotal number of PortTypes: {0}", myServiceDescription->PortTypes->Count ); // Copy the collection into an array. array<PortType^>^ myPortTypeArray = gcnew array<PortType^>(noOfPortTypes); myPortTypeCollection->CopyTo( myPortTypeArray, 0 ); // Display names of all PortTypes. for ( int i = 0; i < noOfPortTypes; i++ ) { Console::WriteLine( "PortType name: {0}", myPortTypeArray[ i ]->Name ); } myServiceDescription->Write( "MathService_New.wsdl" );
.NET Framework
Available since 1.1
Available since 1.1
Show: