Langue

ServiceDescriptionCollection.IndexOf(ServiceDescription) Méthode

Définition

Recherche l’index spécifié ServiceDescription et retourne l’index de base zéro de la première occurrence dans la collection.

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

Paramètres

serviceDescription
ServiceDescription

Pour ServiceDescription lequel effectuer une recherche dans la collection.

Retours

Index de base zéro de la description de service spécifiée, ou -1 si l’élément n’a pas été trouvé dans la collection.

Exemples

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

S’applique à