PortCollection クラス

定義

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

public ref class PortCollection sealed : System::Web::Services::Description::ServiceDescriptionBaseCollection
public sealed class PortCollection : System.Web.Services.Description.ServiceDescriptionBaseCollection
type PortCollection = class
    inherit ServiceDescriptionBaseCollection
Public NotInheritable Class PortCollection
Inherits ServiceDescriptionBaseCollection
継承

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_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");
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

プロパティ

Capacity

CollectionBase に格納できる要素の数を取得または設定します。

(継承元 CollectionBase)
Count

CollectionBase インスタンスに含まれる要素の数を取得します。 このプロパティはオーバーライドできません。

(継承元 CollectionBase)
InnerList

ArrayList インスタンス内の要素のリストを格納する CollectionBase を取得します。

(継承元 CollectionBase)
Item[Int32]

指定の 0 から始まるインデックス番号に対応する Port の値を取得または設定します。

Item[String]

名前で指定された Port を取得します。

List

IList インスタンス内の要素のリストを格納する CollectionBase を取得します。

(継承元 CollectionBase)
Table

ServiceDescriptionBaseCollection 内のキーと値の関連付けを実装するインターフェイスを取得します。

(継承元 ServiceDescriptionBaseCollection)

メソッド

Add(Port)

指定した PortPortCollection の末尾に追加します。

Clear()

CollectionBase インスタンスからすべてのオブジェクトを削除します。 このメソッドはオーバーライドできません。

(継承元 CollectionBase)
Contains(Port)

指定した PortPortCollection のメンバーかどうかを示す値を返します。

CopyTo(Port[], Int32)

PortCollection 型の 1 次元配列に、その配列内の指定した 0 から始まるインデックスを開始位置として Port 全体をコピーします。

Equals(Object)

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetEnumerator()

CollectionBase インスタンスを反復処理する列挙子を返します。

(継承元 CollectionBase)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetKey(Object)

参照によって渡された値に関連付けられているキーの名前を返します。

(継承元 ServiceDescriptionBaseCollection)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
IndexOf(Port)

指定した Port を検索し、コレクション内で最初に見つかった位置の 0 から始まるインデックス番号を返します。

Insert(Int32, Port)

Port の指定したインデックス位置に、指定した PortCollection インスタンスを追加します。

MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
OnClear()

ServiceDescriptionBaseCollection インスタンスの内容を消去します。

(継承元 ServiceDescriptionBaseCollection)
OnClearComplete()

CollectionBase インスタンスの内容を消去した後に、追加のカスタム プロセスを実行します。

(継承元 CollectionBase)
OnInsert(Int32, Object)

CollectionBase インスタンスに新しい要素を挿入する前に、追加のカスタム プロセスを実行します。

(継承元 CollectionBase)
OnInsertComplete(Int32, Object)

ServiceDescriptionBaseCollection に新しい要素を挿入した後に、追加のカスタム プロセスを実行します。

(継承元 ServiceDescriptionBaseCollection)
OnRemove(Int32, Object)

ServiceDescriptionBaseCollection から要素を削除します。

(継承元 ServiceDescriptionBaseCollection)
OnRemoveComplete(Int32, Object)

CollectionBase インスタンスから要素を削除した後に、追加のカスタム プロセスを実行します。

(継承元 CollectionBase)
OnSet(Int32, Object, Object)

値を ServiceDescriptionBaseCollection 内の別の値に置き換えます。

(継承元 ServiceDescriptionBaseCollection)
OnSetComplete(Int32, Object, Object)

CollectionBase インスタンスに値を設定した後に、追加のカスタム プロセスを実行します。

(継承元 CollectionBase)
OnValidate(Object)

値を検証するときに、追加のカスタム プロセスを実行します。

(継承元 CollectionBase)
Remove(Port)

Port 内で最初に見つかった指定の PortCollection を削除します。

RemoveAt(Int32)

CollectionBase インスタンスの指定したインデックスにある要素を削除します。 このメソッドはオーバーライドできません。

(継承元 CollectionBase)
SetParent(Object, Object)

ServiceDescriptionBaseCollection インスタンスの親オブジェクトを設定します。

(継承元 ServiceDescriptionBaseCollection)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

明示的なインターフェイスの実装

ICollection.CopyTo(Array, Int32)

CollectionBase 全体を互換性のある 1 次元の Array にコピーします。コピー操作は、コピー先の配列の指定したインデックスから始まります。

(継承元 CollectionBase)
ICollection.IsSynchronized

CollectionBase へのアクセスが同期されている (スレッド セーフである) かどうかを示す値を取得します。

(継承元 CollectionBase)
ICollection.SyncRoot

CollectionBase へのアクセスを同期するために使用できるオブジェクトを取得します。

(継承元 CollectionBase)
IList.Add(Object)

CollectionBase の末尾にオブジェクトを追加します。

(継承元 CollectionBase)
IList.Contains(Object)

CollectionBase に特定の要素が格納されているかどうかを判断します。

(継承元 CollectionBase)
IList.IndexOf(Object)

指定した Object を検索し、CollectionBase 全体内で最初に見つかった位置の 0 から始まるインデックスを返します。

(継承元 CollectionBase)
IList.Insert(Int32, Object)

CollectionBase 内の指定したインデックスの位置に要素を挿入します。

(継承元 CollectionBase)
IList.IsFixedSize

CollectionBase が固定サイズかどうかを示す値を取得します。

(継承元 CollectionBase)
IList.IsReadOnly

CollectionBase が読み取り専用かどうかを示す値を取得します。

(継承元 CollectionBase)
IList.Item[Int32]

指定したインデックスにある要素を取得または設定します。

(継承元 CollectionBase)
IList.Remove(Object)

特定のオブジェクトが CollectionBase 内にあるときに、最初に出現したものを削除します。

(継承元 CollectionBase)

拡張メソッド

Cast<TResult>(IEnumerable)

IEnumerable の要素を、指定した型にキャストします。

OfType<TResult>(IEnumerable)

指定された型に基づいて IEnumerable の要素をフィルター処理します。

AsParallel(IEnumerable)

クエリの並列化を有効にします。

AsQueryable(IEnumerable)

IEnumerableIQueryable に変換します。

適用対象