OperationBindingCollection.Insert(Int32, OperationBinding) Metoda

Definicja

Dodaje określone OperationBinding wystąpienie do określonego OperationBindingCollection indeksu opartego na zera.

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)

Parametry

index
Int32

Indeks oparty na zera, w którym ma być wstawiony bindingOperation parametr.

bindingOperation
OperationBinding

Element OperationBinding do dodania do kolekcji.

Przykłady

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

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

Uwagi

Jeśli liczba elementów w kolekcji jest już równa pojemności kolekcji, pojemność jest podwojona przez automatyczne cofnięcie przydziału tablicy wewnętrznej przed wstawieniem nowego elementu.

index Jeśli parametr jest równy Count, bindingOperation parametr zostanie dodany na końcu OperationBindingCollection.

Elementy po przejściu punktu wstawiania w dół, aby pomieścić nowy element.

Dotyczy