Partager via


OperationCollection.IndexOf(Operation) Méthode

Définition

Recherche le Operation 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::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

Paramètres

operation
Operation

Operation à rechercher dans la collection.

Retours

Int32

Entier signé 32 bits.

Exemples

L'exemple suivant illustre l'utilisation de la méthode 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

S’applique à