ServiceDescriptionCollection.IndexOf(ServiceDescription) Yöntem

Tanım

Belirtilen ServiceDescription öğesini arar ve koleksiyondaki ilk oluşumun sıfır tabanlı dizinini döndürür.

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

Parametreler

serviceDescription
ServiceDescription

ServiceDescription Koleksiyonda aranacak olan.

Döndürülenler

Int32

Belirtilen hizmet açıklamasının sıfır tabanlı dizini veya öğe koleksiyonda bulunamadıysa -1.

Örnekler

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

Şunlara uygulanır