Freigeben über


BindingCollection.Remove-Methode

Entfernt das erste Vorkommen des angegebenen Binding aus BindingCollection.

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

Syntax

'Declaration
Public Sub Remove ( _
    binding As Binding _
)
'Usage
Dim instance As BindingCollection
Dim binding As Binding

instance.Remove(binding)
public void Remove (
    Binding binding
)
public:
void Remove (
    Binding^ binding
)
public void Remove (
    Binding binding
)
public function Remove (
    binding : Binding
)

Parameter

  • binding
    Das aus der Auflistung zu entfernende Binding.

Hinweise

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

Die Elemente, die auf die entfernte Binding folgen, werden nach oben verschoben, um die frei gewordene Stelle einzunehmen.

Beispiel

Dim myServiceDescription As ServiceDescription = ServiceDescription.Read("MathService_input.wsdl")
Console.WriteLine(("Total Number of bindings defined are:" + myServiceDescription.Bindings.Count.ToString()))
myBinding = myServiceDescription.Bindings(0)

' Remove the first binding in the collection.
myServiceDescription.Bindings.Remove(myBinding)
Console.WriteLine(("Successfully removed binding " + myBinding.Name))
Console.WriteLine(("Total Number of bindings defined now are:" + myServiceDescription.Bindings.Count.ToString()))
myServiceDescription.Write("MathService_temp.wsdl")
ServiceDescription myServiceDescription = ServiceDescription.Read("MathService_input.wsdl");
 Console.WriteLine("Total Number of bindings defined are:" + myServiceDescription.Bindings.Count);
  myBinding = myServiceDescription.Bindings[0];
 
 // Remove the first binding in the collection.
 myServiceDescription.Bindings.Remove(myBinding);
 Console.WriteLine("Successfully removed binding " + myBinding.Name);
 Console.WriteLine("Total Number of bindings defined now are:" + myServiceDescription.Bindings.Count);
 myServiceDescription.Write("MathService_temp.wsdl");
ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MathService_input.wsdl" );
Console::WriteLine( "Total Number of bindings defined are: {0}", myServiceDescription->Bindings->Count );
myBinding = myServiceDescription->Bindings[ 0 ];

// Remove the first binding in the collection.
myServiceDescription->Bindings->Remove( myBinding );
Console::WriteLine( "Successfully removed binding {0}", myBinding->Name );
Console::WriteLine( "Total Number of bindings defined now are: {0}", myServiceDescription->Bindings->Count );
myServiceDescription->Write( "MathService_temp.wsdl" );
ServiceDescription myServiceDescription = 
    ServiceDescription.Read("MathService_input.wsdl");
Console.WriteLine("Total Number of bindings defined are:" 
    + myServiceDescription.get_Bindings().get_Count());
myBinding = myServiceDescription.get_Bindings().get_Item(0);

// Remove the first binding in the collection.
myServiceDescription.get_Bindings().Remove(myBinding);
Console.WriteLine("Successfully removed binding " 
    + myBinding.get_Name());
Console.WriteLine("Total Number of bindings defined now are:" 
    + myServiceDescription.get_Bindings().get_Count());
myServiceDescription.Write("MathService_temp.wsdl");

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

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