BindingCollection.Contains Method

Returns a value indicating whether the specified Binding is a member of the BindingCollection.

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

public:
bool Contains (
	Binding^ binding
)
public boolean Contains (
	Binding binding
)
public function Contains (
	binding : Binding
) : boolean
Not applicable.

Parameters

binding

A Binding for which to check collection membership.

Return Value

true if the binding parameter is a member of the BindingCollection; otherwise, false.

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" );

// Add binding to the ServiceDescription instance.
myServiceDescription->Bindings->Add( myBinding );

if ( myServiceDescription->Bindings->Contains( myBinding ) )
   Console::WriteLine( "Successfully added binding {0}", myBinding->Name );

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");

// Add binding to the ServiceDescription instance.
myServiceDescription.get_Bindings().Add(myBinding);

if (myServiceDescription.get_Bindings().Contains(myBinding)) {
    Console.WriteLine("Successfully added binding " 
        + myBinding.get_Name());
}

Windows 98, Windows Server 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

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show: