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

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

PortTypeCollection.Insert メソッド

指定した 0 から始まるインデックス番号にある PortTypeCollection に、指定した PortType追加します

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

Public Sub Insert ( _
    index As Integer, _
    portType As PortType _
)
Dim instance As PortTypeCollection
Dim index As Integer
Dim portType As PortType

instance.Insert(index, portType)
public void Insert (
    int index,
    PortType portType
)
public:
void Insert (
    int index, 
    PortType^ portType
)
public void Insert (
    int index, 
    PortType portType
)
public function Insert (
    index : int, 
    portType : PortType
)

パラメータ

index

portType パラメータ挿入する位置の、0 から始まるインデックス番号

portType

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

例外例外
例外種類条件

IndexOutOfRangeException

index パラメータが 0 未満です。

または

index パラメータCount より大きい値です。

解説解説
使用例使用例
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: " & noOfPortTypes.ToString())

Dim myNewPortType As PortType = myPortTypeCollection("MathServiceSoap")
' Get the index in the collection.
Dim index As Integer = myPortTypeCollection.IndexOf(myNewPortType)
Console.WriteLine("Removing the PortType named " &
 _
   myNewPortType.Name)

' Remove the PortType from the collection.
myPortTypeCollection.Remove(myNewPortType)
noOfPortTypes = myServiceDescription.PortTypes.Count
Console.WriteLine(ControlChars.Newline & _
   "Total number of PortTypes: " & noOfPortTypes.ToString())

' Check whether the PortType exists in the collection.
Dim bContains As Boolean
 = myPortTypeCollection.Contains(myNewPortType)
Console.WriteLine("Port Type'" & myNewPortType.Name &
 _
   "' exists: " & bContains.ToString())

Console.WriteLine("Adding the 'PortType'")
' Insert a new portType at the index location.
myPortTypeCollection.Insert(index, myNewPortType)
ServiceDescription myServiceDescription = 
   ServiceDescription.Read("MathService_CS.wsdl");

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

PortType myNewPortType = myPortTypeCollection["MathServiceSoap"];

// Get the index in the collection.
int index = myPortTypeCollection.IndexOf(myNewPortType);
Console.WriteLine("Removing the PortType named " 
   + myNewPortType.Name);

// Remove the PortType from the collection.
myPortTypeCollection.Remove(myNewPortType);
noOfPortTypes = myServiceDescription.PortTypes.Count;
Console.WriteLine("\nTotal number of PortTypes: " 
   + noOfPortTypes);

// Check whether the PortType exists in the collection.
bool bContains = myPortTypeCollection.Contains(myNewPortType);
Console.WriteLine("Port Type'" + myNewPortType.Name + "' exists: "
 
   + bContains );

Console.WriteLine("Adding the PortType");
// Insert a new portType at the index location.
myPortTypeCollection.Insert(index, myNewPortType);
ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MathService_CS.wsdl"
 );
PortTypeCollection^ myPortTypeCollection = myServiceDescription->PortTypes;
int noOfPortTypes = myServiceDescription->PortTypes->Count;
Console::WriteLine( "\nTotal number of PortTypes: {0}", noOfPortTypes );
PortType^ myNewPortType = myPortTypeCollection[ "MathServiceSoap" ];

// Get the index in the collection.
int index = myPortTypeCollection->IndexOf( myNewPortType );

Console::WriteLine( "Removing the PortType named {0}", myNewPortType->Name
 );

// Remove the PortType from the collection.
myPortTypeCollection->Remove( myNewPortType );
noOfPortTypes = myServiceDescription->PortTypes->Count;
Console::WriteLine( "\nTotal number of PortTypes: {0}", noOfPortTypes );

// Check whether the PortType exists in the collection.
bool bContains = myPortTypeCollection->Contains( myNewPortType
 );
Console::WriteLine( "Port Type'{0}' exists: {1}", myNewPortType->Name,
 bContains );
Console::WriteLine( "Adding the PortType" );

// Insert a new portType at the index location.
myPortTypeCollection->Insert( index, myNewPortType );
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: " + noOfPortTypes);

PortType myNewPortType = 
    myPortTypeCollection.get_Item("MathServiceSoap");

// Get the index in the collection.
int index = myPortTypeCollection.IndexOf(myNewPortType);
Console.WriteLine("Removing the PortType named " 
    + myNewPortType.get_Name());

// Remove the PortType from the collection.
myPortTypeCollection.Remove(myNewPortType);
noOfPortTypes = myServiceDescription.get_PortTypes().get_Count();
Console.WriteLine("\nTotal number of PortTypes: " + noOfPortTypes);

// Check whether the PortType exists in the collection.
boolean bContains = myPortTypeCollection.Contains(myNewPortType);
Console.WriteLine("Port Type'" + myNewPortType.get_Name() 
    + "' exists: " + bContains);

Console.WriteLine("Adding the PortType");

// Insert a new portType at the index location.
myPortTypeCollection.Insert(index, myNewPortType);
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
PortTypeCollection クラス
PortTypeCollection メンバ
System.Web.Services.Description 名前空間


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

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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS