Compartilhar via


OperationCollection.IndexOf(Operation) Método

Definição

Pesquisa o Operation especificado e retorna o índice de base zero da primeira ocorrência dentro de toda a coleção.

public:
 int IndexOf(System::Web::Services::Description::Operation ^ operation);
public int IndexOf (System.Web.Services.Description.Operation operation);
member this.IndexOf : System.Web.Services.Description.Operation -> int
Public Function IndexOf (operation As Operation) As Integer

Parâmetros

operation
Operation

O Operation a ser pesquisado na coleção.

Retornos

Um inteiro com sinal de 32 bits.

Exemplos

O exemplo a seguir demonstra o uso do método IndexOf.

if ( myOperationCollection->Contains( myOperation ) == true )
{
   Console::WriteLine( "The index of the added 'myOperation' operation is : {0}", myOperationCollection->IndexOf( myOperation ) );
}
if(myOperationCollection.Contains(myOperation) == true)
{
   Console.WriteLine("The index of the added 'myOperation' " +
                     "operation is : " +
                     myOperationCollection.IndexOf(myOperation));
}
If myOperationCollection.Contains(myOperation) = True Then
   Console.WriteLine("The index of the added 'myOperation' " + _
            "operation is : " + _
            myOperationCollection.IndexOf(myOperation).ToString)
End If

Aplica-se a