ServiceCollection::Remove Method (Service^)

 

Removes the first occurrence of the specified Service from the ServiceCollection.

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

public:
void Remove(
	Service^ service
)

Parameters

service
Type: System.Web.Services.Description::Service^

The Service to remove from the collection.

This method performs a linear search; therefore, the average execution time is proportional to Count.

The elements that follow the removed Service move up to occupy the vacated spot.

// 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 ] );

.NET Framework
Available since 1.1
Return to top
Show: