Freigeben über


OperationBindingCollection.IndexOf(OperationBinding) Methode

Definition

Sucht nach der angegebenen OperationBinding und gibt den nullbasierten Index des ersten Vorkommens in der Auflistung zurück.

public:
 int IndexOf(System::Web::Services::Description::OperationBinding ^ bindingOperation);
public int IndexOf (System.Web.Services.Description.OperationBinding bindingOperation);
member this.IndexOf : System.Web.Services.Description.OperationBinding -> int
Public Function IndexOf (bindingOperation As OperationBinding) As Integer

Parameter

bindingOperation
OperationBinding

Die OperationBinding, nach der in der Auflistung gesucht werden soll.

Gibt zurück

Int32

Eine 32-Bit-Ganzzahl mit Vorzeichen.

Beispiele

Im folgenden Beispiel wird die Verwendung der Insert-Methode gezeigt.

// Insert the OperationBinding of the Add operation at index 0.
myOperationBindingCollection->Insert( 0, addOperationBinding );
Console::WriteLine( "\nInserted the OperationBinding of the "
"Add operation in the collection." );

// Get the index of the OperationBinding of the Add
// operation from the collection.
int index = myOperationBindingCollection->IndexOf( addOperationBinding );
Console::WriteLine( "\nThe index of the OperationBinding of the Add operation : {0}", index );
// Insert the OperationBinding of the Add operation at index 0.
myOperationBindingCollection.Insert(0, addOperationBinding);
Console.WriteLine("\nInserted the OperationBinding of the " +
   "Add operation in the collection.");

// Get the index of the OperationBinding of the Add
// operation from the collection.
int index = myOperationBindingCollection.IndexOf(addOperationBinding);
Console.WriteLine("\nThe index of the OperationBinding of the " +
   "Add operation : " + index);
' Insert the OperationBinding of the Add operation at index 0.
myOperationBindingCollection.Insert(0, addOperationBinding)
Console.WriteLine(ControlChars.NewLine & _
   "Inserted the OperationBinding of the " & _
   "Add operation in the collection.")

' Get the index of the OperationBinding of the Add
' operation from the collection.
Dim index As Integer = myOperationBindingCollection.IndexOf( _
   addOperationBinding)
Console.WriteLine(ControlChars.NewLine & _
   "The index of the OperationBinding of the " & _
   "Add operation : " & index.ToString())

Gilt für