次の方法で共有


ServiceCollection.Remove メソッド

ServiceCollection から、最初に出現する指定した Service を削除します。

Public Sub Remove( _
   ByVal service As Service _)
[C#]
public void Remove(Serviceservice);
[C++]
public: void Remove(Service* service);
[JScript]
public function Remove(
   service : Service);

パラメータ

  • service
    コレクションから削除する Service

解説

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

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

使用例

 
' Read a ServiceDescription from existing WSDL.
Dim myServiceDescription As ServiceDescription = _
   ServiceDescription.Read("Input.vb.wsdl")
myServiceDescription.TargetNamespace = "http://tempuri.org/"

' Get the ServiceCollection of the ServiceDescription.
Dim myServiceCollection As ServiceCollection = _
   myServiceDescription.Services

' Remove the Service at index 0 of the collection.
myServiceCollection.Remove(myServiceDescription.Services.Item(0))

[C#] 
// Read a ServiceDescription from existing WSDL.
ServiceDescription myServiceDescription =
   ServiceDescription.Read("Input_CS.wsdl");
myServiceDescription.TargetNamespace = "http://tempuri.org/";

// Get the ServiceCollection of the ServiceDescription.
ServiceCollection myServiceCollection = myServiceDescription.Services;

// Remove the Service at index 0 of the collection.
myServiceCollection.Remove(myServiceDescription.Services[0]);

[C++] 
// Read a ServiceDescription from existing WSDL.
ServiceDescription* myServiceDescription =
   ServiceDescription::Read(S"Input_CS.wsdl");
myServiceDescription->TargetNamespace = S"http://tempuri.org/";

// Get the ServiceCollection of the ServiceDescription.
ServiceCollection* myServiceCollection = myServiceDescription->Services;

// Remove the Service at index 0 of the collection.
myServiceCollection->Remove(myServiceDescription->Services->Item[0]);

[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 ファミリ

参照

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