ServiceDescriptionCollection.Remove Method (ServiceDescription)

 

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
)

Parameters

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.
myCollection.Remove(myServiceDescription2);
Console.WriteLine("Element at index {0} is removed ", myIndex);

.NET Framework
Available since 1.1
Return to top
Show: