Freigeben über


ServiceCollection.Remove-Methode

Entfernt das erste Vorkommen des angegebenen Service aus der ServiceCollection.

Namespace: System.Web.Services.Description
Assembly: System.Web.Services (in system.web.services.dll)

Syntax

'Declaration
Public Sub Remove ( _
    service As Service _
)
'Usage
Dim instance As ServiceCollection
Dim service As Service

instance.Remove(service)
public void Remove (
    Service service
)
public:
void Remove (
    Service^ service
)
public void Remove (
    Service service
)
public function Remove (
    service : Service
)

Parameter

  • service
    Der aus der Auflistung zu entfernende Service.

Hinweise

Diese Methode führt eine lineare Suche aus. Die durchschnittliche Ausführungszeit ist somit proportional zu Count.

Die Elemente, die auf den entfernten Service folgen, werden nach oben verschoben, um die frei gewordene Stelle einzunehmen.

Beispiel

' 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))
// 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]);
// 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 ] );
// Read a ServiceDescription from existing WSDL.
ServiceDescription myServiceDescription = ServiceDescription.
    Read("Input_JSL.wsdl");
myServiceDescription.set_TargetNamespace("http://tempuri.org/");
// Get the ServiceCollection of the ServiceDescription.
ServiceCollection myServiceCollection = myServiceDescription.
    get_Services();
// Remove the Service at index 0 of the collection.
myServiceCollection.Remove(myServiceDescription.get_Services().
    get_Item(0));

Plattformen

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

ServiceCollection-Klasse
ServiceCollection-Member
System.Web.Services.Description-Namespace