PortCollection.Item[] プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
渡されたパラメーターによって指定された Port インスタンスを取得または設定します。
オーバーロード
Item[Int32] |
指定の 0 から始まるインデックス番号に対応する Port の値を取得または設定します。 |
Item[String] |
名前で指定された Port を取得します。 |
Item[Int32]
指定の 0 から始まるインデックス番号に対応する Port の値を取得または設定します。
public:
property System::Web::Services::Description::Port ^ default[int] { System::Web::Services::Description::Port ^ get(int index); void set(int index, System::Web::Services::Description::Port ^ value); };
public System.Web.Services.Description.Port this[int index] { get; set; }
member this.Item(int) : System.Web.Services.Description.Port with get, set
Default Public Property Item(index As Integer) As Port
パラメーター
プロパティ値
指定したインデックスにあるポートの値。
例
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 );
}
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);
}
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
適用対象
Item[String]
名前で指定された Port を取得します。
public:
property System::Web::Services::Description::Port ^ default[System::String ^] { System::Web::Services::Description::Port ^ get(System::String ^ name); };
public System.Web.Services.Description.Port this[string name] { get; }
member this.Item(string) : System.Web.Services.Description.Port
Default Public ReadOnly Property Item(name As String) As Port
パラメーター
プロパティ値
名前で指定されたポート。
例
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 ) );
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));
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)
適用対象
GitHub で Microsoft と共同作業する
このコンテンツのソースは GitHub にあります。そこで、issue や pull request を作成および確認することもできます。 詳細については、共同作成者ガイドを参照してください。
.NET