ServiceDescriptionCollection.IndexOf(ServiceDescription) Metod

Definition

Söker efter det angivna ServiceDescription och returnerar det nollbaserade indexet för den första förekomsten i samlingen.

public:
 int IndexOf(System::Web::Services::Description::ServiceDescription ^ serviceDescription);
public int IndexOf(System.Web.Services.Description.ServiceDescription serviceDescription);
member this.IndexOf : System.Web.Services.Description.ServiceDescription -> int
Public Function IndexOf (serviceDescription As ServiceDescription) As Integer

Parametrar

serviceDescription
ServiceDescription

För ServiceDescription vilken du kan söka i samlingen.

Returer

Det nollbaserade indexet för den angivna tjänstbeskrivningen eller -1 om elementet inte hittades i samlingen.

Exempel

// 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())

Gäller för