Freigeben über


OperationBindingCollection.IndexOf-Methode

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

Namespace: System.Web.Services.Description
Assembly: System.Web.Services (in system.web.services.dll)

Syntax

'Declaration
Public Function IndexOf ( _
    bindingOperation As OperationBinding _
) As Integer
'Usage
Dim instance As OperationBindingCollection
Dim bindingOperation As OperationBinding
Dim returnValue As Integer

returnValue = instance.IndexOf(bindingOperation)
public int IndexOf (
    OperationBinding bindingOperation
)
public:
int IndexOf (
    OperationBinding^ bindingOperation
)
public int IndexOf (
    OperationBinding bindingOperation
)
public function IndexOf (
    bindingOperation : OperationBinding
) : int

Parameter

  • bindingOperation
    Das OperationBinding, nach dem in der Auflistung gesucht werden soll.

Rückgabewert

Eine 32-Bit-Ganzzahl mit Vorzeichen.

Beispiel

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

' 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())
// 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( "\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);

Plattformen

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

OperationBindingCollection-Klasse
OperationBindingCollection-Member
System.Web.Services.Description-Namespace