OperationBindingCollection.Insert(Int32, OperationBinding) Methode

Definition

Fügt die angegebene OperationBinding Instanz zum OperationBindingCollection angegebenen nullbasierten Index hinzu.

public:
 void Insert(int index, System::Web::Services::Description::OperationBinding ^ bindingOperation);
public void Insert(int index, System.Web.Services.Description.OperationBinding bindingOperation);
member this.Insert : int * System.Web.Services.Description.OperationBinding -> unit
Public Sub Insert (index As Integer, bindingOperation As OperationBinding)

Parameter

index
Int32

Der nullbasierte Index, an dem der bindingOperation Parameter eingefügt werden soll.

bindingOperation
OperationBinding

Das OperationBinding , das der Auflistung hinzugefügt werden soll.

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())

Hinweise

Wenn die Anzahl der Elemente in der Auflistung bereits der Kapazität der Auflistung entspricht, wird die Kapazität verdoppelt, indem das interne Array automatisch neu angeordnet wird, bevor das neue Element eingefügt wird.

Wenn der index Parameter gleich Countist, wird der bindingOperation Parameter am Ende der OperationBindingCollection.

Die Elemente nach der Einfügemarke werden nach unten verschoben, um das neue Element aufzunehmen.

Gilt für: