OperationCollection.Insert(Int32, Operation) Metoda

Definicja

Dodaje określony Operation element do określonego indeksu OperationCollection opartego na zerze.

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)

Parametry

index
Int32

Indeks oparty na zerze, w którym ma być wstawiony operation parametr .

operation
Operation

Element Operation do dodania do kolekcji.

Przykłady

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

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)

Uwagi

Jeśli liczba elementów w kolekcji jest już równa pojemności kolekcji, pojemność jest podwajana przez automatyczne przydzielenie tablicy wewnętrznej przed wstawionym nowym elementem.

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

Elementy po punkcie wstawiania są przenoszone w dół, aby pomieścić nowy element.

Dotyczy