OperationCollection.IndexOf(Operation) Metoda

Definicja

Wyszukuje określony Operation element i zwraca indeks oparty na zerze pierwszego wystąpienia w kolekcji.

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

Parametry

operation
Operation

Element Operation , dla którego ma być wyszukiwany w kolekcji.

Zwraca

Int32

32-bitowa liczba całkowita ze znakiem.

Przykłady

W poniższym przykładzie pokazano użycie IndexOf metody .

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

Dotyczy