ServiceDescriptionCollection.IndexOf(ServiceDescription) Método

Definición

Busca el especificado ServiceDescription y devuelve el índice de base cero de la primera aparición dentro de la colección.

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

Parámetros

serviceDescription
ServiceDescription

ServiceDescription para el que se va a buscar en la colección.

Devoluciones

Índice de base cero de la descripción del servicio especificado o -1 si el elemento no se encontró en la colección.

Ejemplos

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

Se aplica a