PortCollection クラス
アセンブリ: System.Web.Services (system.web.services.dll 内)


Dim myService As Service Dim myPortCollection As PortCollection Dim myServiceDescription As ServiceDescription = _ ServiceDescription.Read("MathServiceItem_vb.wsdl") Console.WriteLine("Total number of services : " & _ myServiceDescription.Services.Count.ToString) Dim i As Integer For i = 0 to myServiceDescription.Services.Count - 1 myService = myServiceDescription.Services(i) Console.WriteLine("Name : " & myService.Name) myPortCollection = myService.Ports ' Create an array of ports. Console.WriteLine(ControlChars.NewLine & "Port collection :") Dim i1 As Integer For i1 = 0 to myService.Ports.Count - 1 Console.WriteLine("Port[" & i1.ToString & "] : " & _ myPortCollection(i1).Name) Next Dim strPort As String = myPortCollection(0).Name Dim myPort As Port = myPortCollection(strPort) Console.WriteLine(ControlChars.NewLine & _ "Index of Port[" & strPort & "] : " & _ myPortCollection.IndexOf(myPort).ToString) Dim myPortTestRemove As Port = myPortCollection(0) Console.WriteLine(ControlChars.NewLine & _ "Total number of ports before removing " & _ "a port '" & myPortTestRemove.Name & "' is : " & _ myService.Ports.Count.ToString) myPortCollection.Remove(myPortTestRemove) Console.WriteLine("Total number of ports after removing " & _ "a port '" & myPortTestRemove.Name & "' is : " & _ myService.Ports.Count.ToString) ' Create the WSDL file. myPortCollection.Insert(0, myPortTestRemove) myServiceDescription.Write("MathServiceItemNew_vb.wsdl") Next
Service myService; PortCollection myPortCollection; ServiceDescription myServiceDescription = ServiceDescription.Read("MathServiceItem_cs.wsdl"); Console.WriteLine("Total number of services : " + myServiceDescription.Services.Count); for(int i=0; i < myServiceDescription.Services.Count; ++i) { myService = myServiceDescription.Services[i]; Console.WriteLine("Name : " + myService.Name); myPortCollection = myService.Ports; // Create an array of ports. Console.WriteLine("\nPort collection :"); for(int i1=0 ; i1 < myService.Ports.Count ; ++i1) { Console.WriteLine("Port[" + i1+"] : " + myPortCollection[i1].Name); } string strPort = myPortCollection[0].Name; Port myPort = myPortCollection[strPort]; Console.WriteLine("\nIndex of Port[" + strPort + "] : " + myPortCollection.IndexOf(myPort)); Port myPortTestRemove = myPortCollection[0]; Console.WriteLine("\nTotal number of ports before removing " + "a port '" + myPortTestRemove.Name +"' is : " + myService.Ports.Count); myPortCollection.Remove(myPortTestRemove); Console.WriteLine("Total number of ports after removing " + "a port '" + myPortTestRemove.Name +"' is : " + myService.Ports.Count); // Create the WSDL file. myPortCollection.Insert(0, myPortTestRemove); myServiceDescription.Write("MathServiceItemNew_cs.wsdl");
Service^ myService; PortCollection^ myPortCollection; ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MathServiceItem_cs.wsdl" ); Console::WriteLine( "Total number of services : {0}", myServiceDescription->Services->Count ); for ( int i = 0; i < myServiceDescription->Services->Count; ++i ) { myService = myServiceDescription->Services[ i ]; Console::WriteLine( "Name : {0}", myService->Name ); myPortCollection = myService->Ports; // Create an array of ports. Console::WriteLine( "\nPort collection :" ); for ( int i1 = 0; i1 < myService->Ports->Count; ++i1 ) { Console::WriteLine( "Port[{0}] : {1}", i1, myPortCollection[ i1 ]->Name ); } String^ strPort = myPortCollection[ 0 ]->Name; Port^ myPort = myPortCollection[ strPort ]; Console::WriteLine( "\nIndex of Port[{0}] : {1}", strPort, myPortCollection->IndexOf( myPort ) ); Port^ myPortTestRemove = myPortCollection[ 0 ]; Console::WriteLine( "\nTotal number of ports before removing a port '{0}' is : {1}", myPortTestRemove->Name, myService->Ports->Count ); myPortCollection->Remove( myPortTestRemove ); Console::WriteLine( "Total number of ports after removing a port '{0}' is : {1}", myPortTestRemove->Name, myService->Ports->Count ); // Create the WSDL file. myPortCollection->Insert( 0, myPortTestRemove ); myServiceDescription->Write( "MathServiceItemNew_cs.wsdl" );
Service myService; PortCollection myPortCollection; ServiceDescription myServiceDescription = ServiceDescription.Read("MathServiceItem_jsl.wsdl"); Console.WriteLine("Total number of services : " + myServiceDescription.get_Services().get_Count()); for (int i = 0; i < myServiceDescription.get_Services(). get_Count(); ++i) { myService = myServiceDescription.get_Services().get_Item(i); Console.WriteLine("Name : " + myService.get_Name()); myPortCollection = myService.get_Ports(); // Create an array of ports. Console.WriteLine("\nPort collection :"); for (int i1 = 0; i1 < myService.get_Ports().get_Count(); ++i1) { Console.WriteLine("Port[" + i1 + "] : " + myPortCollection.get_Item(i1).get_Name()); } String strPort = myPortCollection.get_Item(0).get_Name(); Port myPort = myPortCollection.get_Item(strPort); Console.WriteLine("\nIndex of Port[" + strPort + "] : " + myPortCollection.IndexOf(myPort)); Port myPortTestRemove = myPortCollection.get_Item(0); Console.WriteLine("\nTotal number of ports before removing " + "a port '" + myPortTestRemove.get_Name() + "' is : " + myService.get_Ports().get_Count()); myPortCollection.Remove(myPortTestRemove); Console.WriteLine("Total number of ports after removing " + "a port '" + myPortTestRemove.get_Name() + "' is : " + myService.get_Ports().get_Count()); // Create the WSDL file. myPortCollection.Insert(0, myPortTestRemove); myServiceDescription.Write("MathServiceItemNew_jsl.wsdl");

System.Collections.CollectionBase
System.Web.Services.Description.ServiceDescriptionBaseCollection
System.Web.Services.Description.PortCollection


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


PortCollection プロパティ

名前 | 説明 | |
---|---|---|
![]() | Capacity | CollectionBase に格納できる要素の数を取得または設定します。 ( CollectionBase から継承されます。) |
![]() | Count | CollectionBase インスタンスに格納されている要素の数を取得します。このプロパティはオーバーライドできません。 ( CollectionBase から継承されます。) |
![]() | Item | オーバーロードされます。 渡されたパラメータによって指定された Port インスタンスを取得または設定します。 |

名前 | 説明 | |
---|---|---|
![]() | InnerList | CollectionBase インスタンス内の要素のリストを格納する ArrayList を取得します。 ( CollectionBase から継承されます。) |
![]() | List | CollectionBase インスタンス内の要素のリストを格納する IList を取得します。 ( CollectionBase から継承されます。) |

PortCollection メソッド


名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |
![]() | OnClear | CollectionBase インスタンスの内容を消去するときに、追加のカスタム プロセスを実行します。 ( CollectionBase から継承されます。) |
![]() | OnClearComplete | CollectionBase インスタンスの内容を消去した後に、追加のカスタム プロセスを実行します。 ( CollectionBase から継承されます。) |
![]() | OnInsert | CollectionBase インスタンスに新しい要素を挿入する前に、追加のカスタム プロセスを実行します。 ( CollectionBase から継承されます。) |
![]() | OnInsertComplete | CollectionBase インスタンスに新しい要素を挿入した後に、追加のカスタム プロセスを実行します。 ( CollectionBase から継承されます。) |
![]() | OnRemove | CollectionBase インスタンスから要素を削除するときに、追加のカスタム プロセスを実行します。 ( CollectionBase から継承されます。) |
![]() | OnRemoveComplete | CollectionBase インスタンスから要素を削除した後に、追加のカスタム プロセスを実行します。 ( CollectionBase から継承されます。) |
![]() | OnSet | CollectionBase インスタンスに値を設定する前に、追加のカスタム プロセスを実行します。 ( CollectionBase から継承されます。) |
![]() | OnSetComplete | CollectionBase インスタンスに値を設定した後に、追加のカスタム プロセスを実行します。 ( CollectionBase から継承されます。) |
![]() | OnValidate | 値を検証するときに、追加のカスタム プロセスを実行します。 ( CollectionBase から継承されます。) |

PortCollection メンバ
Port クラスのインスタンスのコレクションを表します。このクラスは継承できません。
PortCollection データ型で公開されるメンバを以下の表に示します。

名前 | 説明 | |
---|---|---|
![]() | Capacity | CollectionBase に格納できる要素の数を取得または設定します。(CollectionBase から継承されます。) |
![]() | Count | CollectionBase インスタンスに格納されている要素の数を取得します。このプロパティはオーバーライドできません。(CollectionBase から継承されます。) |
![]() | Item | オーバーロードされます。 渡されたパラメータによって指定された Port インスタンスを取得または設定します。 |

名前 | 説明 | |
---|---|---|
![]() | InnerList | CollectionBase インスタンス内の要素のリストを格納する ArrayList を取得します。(CollectionBase から継承されます。) |
![]() | List | CollectionBase インスタンス内の要素のリストを格納する IList を取得します。(CollectionBase から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Add | 指定した Port を PortCollection の末尾に追加します。 |
![]() | Clear | CollectionBase インスタンスからすべてのオブジェクトを削除します。このメソッドはオーバーライドできません。 (CollectionBase から継承されます。) |
![]() | Contains | 指定した Port が PortCollection のメンバかどうかを示す値を返します。 |
![]() | CopyTo | Port 型の 1 次元配列に、その配列内の指定した 0 から始まるインデックスを開始位置として PortCollection 全体をコピーします。 |
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetEnumerator | CollectionBase インスタンスを反復処理する列挙子を返します。 (CollectionBase から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | IndexOf | 指定した Port を検索し、コレクション内で最初に見つかった位置の 0 から始まるインデックス番号を返します。 |
![]() | Insert | PortCollection の指定したインデックス位置に、指定した Port インスタンスを追加します。 |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | Remove | PortCollection 内で最初に見つかった指定の Port を削除します。 |
![]() | RemoveAt | CollectionBase インスタンスの指定したインデックスにある要素を削除します。このメソッドはオーバーライドできません。 (CollectionBase から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |
![]() | OnClear | CollectionBase インスタンスの内容を消去するときに、追加のカスタム プロセスを実行します。 (CollectionBase から継承されます。) |
![]() | OnClearComplete | CollectionBase インスタンスの内容を消去した後に、追加のカスタム プロセスを実行します。 (CollectionBase から継承されます。) |
![]() | OnInsert | CollectionBase インスタンスに新しい要素を挿入する前に、追加のカスタム プロセスを実行します。 (CollectionBase から継承されます。) |
![]() | OnInsertComplete | CollectionBase インスタンスに新しい要素を挿入した後に、追加のカスタム プロセスを実行します。 (CollectionBase から継承されます。) |
![]() | OnRemove | CollectionBase インスタンスから要素を削除するときに、追加のカスタム プロセスを実行します。 (CollectionBase から継承されます。) |
![]() | OnRemoveComplete | CollectionBase インスタンスから要素を削除した後に、追加のカスタム プロセスを実行します。 (CollectionBase から継承されます。) |
![]() | OnSet | CollectionBase インスタンスに値を設定する前に、追加のカスタム プロセスを実行します。 (CollectionBase から継承されます。) |
![]() | OnSetComplete | CollectionBase インスタンスに値を設定した後に、追加のカスタム プロセスを実行します。 (CollectionBase から継承されます。) |
![]() | OnValidate | 値を検証するときに、追加のカスタム プロセスを実行します。 (CollectionBase から継承されます。) |

- PortCollectionのページへのリンク