Condividi tramite


OperationCollection.IndexOf(Operation) Metodo

Definizione

Cerca l'oggetto Operation specificato e restituisce l'indice in base zero della prima occorrenza all'interno dell'insieme.

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

Parametri

operation
Operation

Oggetto Operation da cercare nell'insieme.

Restituisce

Intero con segno a 32 bit.

Esempio

Nell'esempio seguente viene illustrato l'uso del metodo 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

Si applica a