OperationCollection.IndexOf(Operation) Metod

Definition

Söker efter det angivna Operation och returnerar det nollbaserade indexet för den första förekomsten i samlingen.

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

Parametrar

operation
Operation

För Operation vilken du kan söka i samlingen.

Returer

Ett 32-bitars signerat heltal.

Exempel

I följande exempel visas användningen av metoden IndexOf.

if ( myOperationCollection->Contains( myOperation ))
{
   Console::WriteLine( "The index of the added 'myOperation' operation is : {0}", myOperationCollection->IndexOf( myOperation ) );
}
if (myOperationCollection.Contains(myOperation))
{
   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

Gäller för