Sdílet prostřednictvím


ServiceDescriptionCollection.IndexOf(ServiceDescription) Metoda

Definice

Vyhledá zadaný ServiceDescription index a vrátí nulový index prvního výskytu v kolekci.

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

Parametry

serviceDescription
ServiceDescription

Pro ServiceDescription které se má v kolekci hledat.

Návraty

Int32

Index založený na nule zadaného popisu služby nebo -1, pokud nebyl prvek v kolekci nalezen.

Příklady

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

Platí pro