Bahasa

OperationCollection.Insert(Int32, Operation) Metode

Definisi

Menambahkan yang ditentukan Operation ke OperationCollection pada indeks berbasis nol yang ditentukan.

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

Parameter

index
Int32

Indeks berbasis nol untuk menyisipkan operation parameter.

operation
Operation

untuk Operation ditambahkan ke koleksi.

Contoh

Contoh berikut menunjukkan penggunaan Insert metode .

myOperationCollection->Remove( myOperation );

// Insert the 'myOpearation' operation at the index '0'.
myOperationCollection->Insert( 0, myOperation );
Console::WriteLine( "The operation at index '0' is : {0}", myOperationCollection[ 0 ]->Name );
myOperationCollection.Remove(myOperation);
// Insert the 'myOpearation' operation at the index '0'.
myOperationCollection.Insert(0, myOperation);
Console.WriteLine("The operation at index '0' is : " +
                  myOperationCollection[0].Name);
myOperationCollection.Remove(myOperation)
' Insert the 'myOpearation' operation at the index '0'.
myOperationCollection.Insert(0, myOperation)
Console.WriteLine("The operation at index '0' is : " + _
                  myOperationCollection.Item(0).Name)

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, operation parameter ditambahkan ke akhir OperationCollection.

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

Berlaku untuk