PortCollectionとは? わかりやすく解説

PortCollection クラス

Port クラスインスタンスコレクション表します。このクラス継承できません。

名前空間: System.Web.Services.Description
アセンブリ: System.Web.Services (system.web.services.dll 内)
構文構文

Public NotInheritable Class
 PortCollection
    Inherits ServiceDescriptionBaseCollection
Dim instance As PortCollection
public sealed class PortCollection : ServiceDescriptionBaseCollection
public ref class PortCollection sealed : public
 ServiceDescriptionBaseCollection
public final class PortCollection extends ServiceDescriptionBaseCollection
public final class PortCollection extends
 ServiceDescriptionBaseCollection
使用例使用例
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.Object
   System.Collections.CollectionBase
     System.Web.Services.Description.ServiceDescriptionBaseCollection
      System.Web.Services.Description.PortCollection
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
PortCollection メンバ
System.Web.Services.Description 名前空間

PortCollection プロパティ


パブリック プロパティパブリック プロパティ

プロテクト プロパティプロテクト プロパティ
  名前 説明
プロテクト プロパティ InnerList  CollectionBase インスタンス内の要素リスト格納する ArrayList を取得します。 ( CollectionBase から継承されます。)
プロテクト プロパティ List  CollectionBase インスタンス内の要素リスト格納する IList を取得します。 ( CollectionBase から継承されます。)
参照参照

関連項目

PortCollection クラス
System.Web.Services.Description 名前空間

PortCollection メソッド


パブリック メソッドパブリック メソッド

( プロテクト メソッド参照)
  名前 説明
パブリック メソッド Add 指定した Port を PortCollection の末尾追加します
パブリック メソッド Clear  CollectionBase インスタンスかすべてのオブジェクト削除します。このメソッドオーバーライドできません。 ( CollectionBase から継承されます。)
パブリック メソッド Contains 指定した PortPortCollectionメンバかどうかを示す値を返します
パブリック メソッド 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 クラス
System.Web.Services.Description 名前空間

PortCollection メンバ

Port クラスインスタンスコレクション表します。このクラス継承できません。

PortCollection データ型公開されるメンバを以下の表に示します


パブリック プロパティパブリック プロパティ
プロテクト プロパティプロテクト プロパティ
  名前 説明
プロテクト プロパティ InnerList  CollectionBase インスタンス内の要素リスト格納する ArrayList を取得します。(CollectionBase から継承されます。)
プロテクト プロパティ List  CollectionBase インスタンス内の要素リスト格納する IList を取得します。(CollectionBase から継承されます。)
パブリック メソッドパブリック メソッド
( プロテクト メソッド参照)
  名前 説明
パブリック メソッド Add 指定した Port を PortCollection の末尾追加します
パブリック メソッド Clear  CollectionBase インスタンスかすべてのオブジェクト削除します。このメソッドオーバーライドできません。 (CollectionBase から継承されます。)
パブリック メソッド Contains 指定した PortPortCollectionメンバかどうかを示す値を返します
パブリック メソッド 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 クラス
System.Web.Services.Description 名前空間



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「PortCollection」の関連用語

PortCollectionのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



PortCollectionのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS