ServiceDescriptionCollection.IndexOf(ServiceDescription) Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
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())