ServiceDescriptionCollection.Remove Method (ServiceDescription)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Removes the first occurrence of the specified ServiceDescription from the collection.

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

public void Remove(
	ServiceDescription serviceDescription


Type: System.Web.Services.Description.ServiceDescription

The ServiceDescription 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 ServiceDescription move up to occupy the vacated spot.

// Get the index of 'ServiceDescription' object.
int myIndex = myCollection.IndexOf(myServiceDescription2); 
// Remove 'ServiceDescription' object from the collection.
Console.WriteLine("Element at index {0} is removed ", myIndex);

.NET Framework
Available since 1.1
Return to top