PortTypeCollection.CopyTo(PortType[], Int32) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
대상 배열의 지정된 인덱스(0부터 시작)에서 시작하여 전체 PortTypeCollection을 PortType 형식의 1차원 배열에 복사합니다.
public:
void CopyTo(cli::array <System::Web::Services::Description::PortType ^> ^ array, int index);
public void CopyTo (System.Web.Services.Description.PortType[] array, int index);
member this.CopyTo : System.Web.Services.Description.PortType[] * int -> unit
Public Sub CopyTo (array As PortType(), index As Integer)
매개 변수
- index
- Int32
복사된 컬렉션을 배치하기 시작할 인덱스(0부터 시작)입니다.
예제
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" );
PortTypeCollection myPortTypeCollection;
ServiceDescription myServiceDescription =
ServiceDescription.Read("MathService_CS.wsdl");
myPortTypeCollection = myServiceDescription.PortTypes;
int noOfPortTypes = myServiceDescription.PortTypes.Count;
Console.WriteLine("\nTotal number of PortTypes: "
+ myServiceDescription.PortTypes.Count);
// Copy the collection into an array.
PortType[] myPortTypeArray = new PortType[noOfPortTypes];
myPortTypeCollection.CopyTo(myPortTypeArray, 0);
// Display names of all PortTypes.
for(int i = 0; i < noOfPortTypes; i++)
Console.WriteLine("PortType name: " + myPortTypeArray[i].Name);
myServiceDescription.Write("MathService_New.wsdl");
Dim myPortTypeCollection As PortTypeCollection
Dim myServiceDescription As ServiceDescription = _
ServiceDescription.Read("MathService_VB.wsdl")
myPortTypeCollection = myServiceDescription.PortTypes
Dim noOfPortTypes As Integer = myServiceDescription.PortTypes.Count
Console.WriteLine( _
ControlChars.NewLine + "Total number of PortTypes: " & _
myServiceDescription.PortTypes.Count.ToString())
' Copy the collection into an array.
Dim myPortTypeArray(noOfPortTypes-1) As PortType
myPortTypeCollection.CopyTo(myPortTypeArray, 0)
' Display names of all PortTypes.
Dim i As Integer
For i = 0 To noOfPortTypes - 1
Console.WriteLine("PortType Name: " + myPortTypeArray(i).Name)
Next i
myServiceDescription.Write("MathService_New.wsdl")