編輯

共用方式為


ServiceDescriptionCollection.Remove(ServiceDescription) Method

Definition

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

public:
 void Remove(System::Web::Services::Description::ServiceDescription ^ serviceDescription);
public void Remove (System.Web.Services.Description.ServiceDescription serviceDescription);
member this.Remove : System.Web.Services.Description.ServiceDescription -> unit
Public Sub Remove (serviceDescription As ServiceDescription)

Parameters

serviceDescription
ServiceDescription

The ServiceDescription to remove from the collection.

Examples

// 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);
' Get the index of 'ServiceDescription' object.
Dim myIndex As Integer = myCollection.IndexOf(myServiceDescription2)
' Remove 'ServiceDescription' object from the collection.
myCollection.Remove(myServiceDescription2)
Console.WriteLine("Element at index {0} is removed ", myIndex.ToString())

Remarks

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.

Applies to