Bahasa

OperationBindingCollection.Insert(Int32, OperationBinding) Metode

Definisi

Menambahkan instans yang ditentukan OperationBinding ke OperationBindingCollection pada indeks berbasis nol yang ditentukan.

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

Indeks berbasis nol untuk menyisipkan bindingOperation parameter.

bindingOperation
OperationBinding

untuk OperationBinding ditambahkan ke koleksi.

Contoh

Contoh berikut menunjukkan penggunaan Insert metode .

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

Keterangan

Jika jumlah item dalam koleksi sudah sama dengan kapasitas koleksi, kapasitas digandakan dengan secara otomatis merealokasi array internal sebelum elemen baru dimasukkan.

index Jika parameter sama dengan Count, bindingOperation parameter ditambahkan ke akhir OperationBindingCollection.

Elemen setelah titik penyisipan bergerak ke bawah untuk mengakomodasi elemen baru.

Berlaku untuk