Partilhar via


OperationMessageCollection.IndexOf(OperationMessage) Método

Definição

Pesquisa o OperationMessage 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::OperationMessage ^ operationMessage);
public int IndexOf (System.Web.Services.Description.OperationMessage operationMessage);
member this.IndexOf : System.Web.Services.Description.OperationMessage -> int
Public Function IndexOf (operationMessage As OperationMessage) As Integer

Parâmetros

operationMessage
OperationMessage

O OperationMessage a ser pesquisado na coleção.

Retornos

O índice de base zero da mensagem de operação especificada ou -1, se o elemento não tiver sido encontrado na coleção.

Exemplos

if ( myOperationMessageCollection->Contains( myOperationMessage ) == true )
{
   int myIndex = myOperationMessageCollection->IndexOf( myOperationMessage );
   Console::WriteLine( " The index of the Add operation message in the collection is : {0}", myIndex );
}
if(myOperationMessageCollection.Contains(myOperationMessage)
   == true )
{
   int myIndex =
      myOperationMessageCollection.IndexOf(myOperationMessage);
   Console.WriteLine(" The index of the Add operation " +
      "message in the collection is : " + myIndex);
}
If myOperationMessageCollection.Contains(myOperationMessage) _
   = True Then
   Dim myIndex As Integer = _
      myOperationMessageCollection.IndexOf(myOperationMessage)
   Console.WriteLine(" The index of the Add operation " & _
       "message in the collection is : " & myIndex.ToString())
End If

Aplica-se a