次の方法で共有


ServiceDescriptionCollection.Remove メソッド

コレクションから、最初に出現する指定した ServiceDescription を削除します。

Public Sub Remove( _
   ByVal serviceDescription As ServiceDescription _)
[C#]
public void Remove(ServiceDescriptionserviceDescription);
[C++]
public: void Remove(ServiceDescription* serviceDescription);
[JScript]
public function Remove(
   serviceDescription : ServiceDescription);

パラメータ

解説

このメソッドはリニア サーチを実行します。したがって、平均検索時間は Count に比例します。

削除された ServiceDescription の後続の要素は、空白になった場所に上に詰めて移動します。

使用例

 
' Get the index of a ServiceDescription.
Dim myIndex As Integer = myCollection.IndexOf(myServiceDescription2)

' Remove a ServiceDescription from the collection.
myCollection.Remove(myServiceDescription2)
Console.WriteLine("Element at index {0} is removed.", _
   myIndex.ToString())

[C#] 
// Get the index of a ServiceDescription.
int myIndex = myCollection.IndexOf(myServiceDescription2);
 
// Remove a ServiceDescription from the collection.
myCollection.Remove(myServiceDescription2);
Console.WriteLine("Element at index {0} is removed.", myIndex);

[C++] 
// Get the index of 'ServiceDescription' object.
int myIndex = myCollection->IndexOf(myServiceDescription2);
// Remove 'ServiceDescription' object from the collection.
myCollection->Remove(myServiceDescription2);
Console::WriteLine(S"Element at index {0} is removed ",__box( myIndex));

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

参照

ServiceDescriptionCollection クラス | ServiceDescriptionCollection メンバ | System.Web.Services.Description 名前空間