PortTypeCollection.Add メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > PortTypeCollection.Add メソッドの意味・解説 

PortTypeCollection.Add メソッド

指定した PortType を PortTypeCollection の末尾追加します

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

Public Function Add ( _
    portType As PortType _
) As Integer
Dim instance As PortTypeCollection
Dim portType As PortType
Dim returnValue As Integer

returnValue = instance.Add(portType)
public int Add (
    PortType portType
)
public:
int Add (
    PortType^ portType
)
public int Add (
    PortType portType
)
public function Add (
    portType : PortType
) : int

パラメータ

portType

コレクション追加する PortType。

戻り値
portType パラメータ追加された、0 から始まるインデックス番号

使用例使用例
Dim myServiceDescription As ServiceDescription
 = _
   ServiceDescription.Read("MathService_VB.wsdl")
Dim myPortTypeCollection As PortTypeCollection
 = _
   myServiceDescription.PortTypes

Dim noOfPortTypes As Integer
 = myServiceDescription.PortTypes.Count
Console.WriteLine( _
   ControlChars.Newline & "Total number of PortTypes: "
 & _
   myServiceDescription.PortTypes.Count.ToString())

' Get the first PortType in the collection.
Dim myNewPortType As PortType = myPortTypeCollection(0)
Console.WriteLine( _
   "The PortType at index 0 is: " & myNewPortType.Name)
Console.WriteLine("Removing the PortType " & myNewPortType.Name)

' Remove the PortType from the collection.
myPortTypeCollection.Remove(myNewPortType)

' Display the number of PortTypes.
Console.WriteLine(ControlChars.Newline & _
   "Total number of PortTypes after removing: " &
 _
   myServiceDescription.PortTypes.Count.ToString())

Console.WriteLine("Adding a PortType " & myNewPortType.Name)

' Add a new PortType from the collection.
myPortTypeCollection.Add(myNewPortType)

' Display the number of PortTypes after adding a port.
Console.WriteLine( _
   "Total Number of PortTypes after adding a new port: "
 & _
   myServiceDescription.PortTypes.Count.ToString())

myServiceDescription.Write("MathService_New.wsdl")
ServiceDescription myServiceDescription = 
   ServiceDescription.Read("MathService_CS.wsdl");
PortTypeCollection myPortTypeCollection = 
   myServiceDescription.PortTypes;

int noOfPortTypes = myServiceDescription.PortTypes.Count;
Console.WriteLine("\nTotal number of PortTypes: " 
   + myServiceDescription.PortTypes.Count);

// Get the first PortType in the collection.
PortType myNewPortType = myPortTypeCollection[0];
Console.WriteLine(
   "The PortType at index 0 is: " + myNewPortType.Name);
Console.WriteLine("Removing the PortType " + myNewPortType.Name);

// Remove the PortType from the collection.
myPortTypeCollection.Remove(myNewPortType);

// Display the number of PortTypes.
Console.WriteLine("\nTotal number of PortTypes after removing: "
   + myServiceDescription.PortTypes.Count);

Console.WriteLine("Adding a PortType " + myNewPortType.Name);

// Add a new PortType from the collection.
myPortTypeCollection.Add(myNewPortType);

// Display the number of PortTypes after adding a port.
Console.WriteLine("Total number of PortTypes after " +
   "adding a new port: " + myServiceDescription.PortTypes.Count);

myServiceDescription.Write("MathService_New.wsdl");
ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MathService_CS.wsdl"
 );
PortTypeCollection^ myPortTypeCollection = myServiceDescription->PortTypes;
int noOfPortTypes = myServiceDescription->PortTypes->Count;
Console::WriteLine( "\nTotal number of PortTypes: {0}", myServiceDescription->PortTypes->Count
 );

// Get the first PortType in the collection.
PortType^ myNewPortType = myPortTypeCollection[ 0 ];
Console::WriteLine( "The PortType at index 0 is: {0}", myNewPortType->Name
 );
Console::WriteLine( "Removing the PortType {0}", myNewPortType->Name
 );

// Remove the PortType from the collection.
myPortTypeCollection->Remove( myNewPortType );

// Display the number of PortTypes.
Console::WriteLine( "\nTotal number of PortTypes after removing: {0}",
 myServiceDescription->PortTypes->Count );
Console::WriteLine( "Adding a PortType {0}", myNewPortType->Name );

// Add a new PortType from the collection.
myPortTypeCollection->Add( myNewPortType );

// Display the number of PortTypes after adding a port.
Console::WriteLine( "Total number of PortTypes after adding a new
 port: {0}", myServiceDescription->PortTypes->Count );
myServiceDescription->Write( "MathService_New.wsdl" );
ServiceDescription myServiceDescription = ServiceDescription.Read(
    "MathService_JSL.wsdl");
PortTypeCollection myPortTypeCollection = 
    myServiceDescription.get_PortTypes();

int noOfPortTypes = myServiceDescription.get_PortTypes().
    get_Count();
Console.WriteLine("\nTotal number of PortTypes: " 
    + myServiceDescription.get_PortTypes().get_Count());

// Get the first PortType in the collection.
PortType myNewPortType = myPortTypeCollection.get_Item(0);
Console.WriteLine("The PortType at index 0 is: " 
    + myNewPortType.get_Name());
Console.WriteLine("Removing the PortType " 
    + myNewPortType.get_Name());

// Remove the PortType from the collection.
myPortTypeCollection.Remove(myNewPortType);

// Display the number of PortTypes.
Console.WriteLine("\nTotal number of PortTypes after removing: " 
    + myServiceDescription.get_PortTypes().get_Count());
Console.WriteLine("Adding a PortType " + myNewPortType.get_Name());

// Add a new PortType from the collection.
myPortTypeCollection.Add(myNewPortType);

// Display the number of PortTypes after adding a port.
Console.WriteLine("Total number of PortTypes after " 
    + "adding a new port: " + myServiceDescription.get_PortTypes().
    get_Count());
myServiceDescription.Write("MathService_New.wsdl");
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
PortTypeCollection クラス
PortTypeCollection メンバ
System.Web.Services.Description 名前空間


このページでは「.NET Framework クラス ライブラリ リファレンス」からPortTypeCollection.Add メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からPortTypeCollection.Add メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からPortTypeCollection.Add メソッド を検索

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

辞書ショートカット

すべての辞書の索引

PortTypeCollection.Add メソッドのお隣キーワード
検索ランキング

   

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



PortTypeCollection.Add メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS