Partager via


OperationMessageCollection.IndexOf(OperationMessage) Méthode

Définition

Recherche le OperationMessage spécifié et retourne l'index de base zéro de la première occurrence dans la collection.

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

Paramètres

operationMessage
OperationMessage

OperationMessage à rechercher dans la collection.

Retours

Int32

Index de base zéro du message d'opération spécifié, ou -1 si l'élément est introuvable dans la collection.

Exemples

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

S’applique à