Język

OperationMessageCollection.Insert(Int32, OperationMessage) Metoda

Definicja

Dodaje określony OperationMessage element do określonego indeksu OperationMessageCollection opartego na zerach.

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

Parametry

index
Int32

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

operationMessage
OperationMessage

Element OperationMessage do dodania do kolekcji.

Przykłady

myOperationMessageCollection->Remove( myInputOperationMessage );

// Display Flow, Input, and Output after removing.
DisplayFlowInputOutput( myOperationMessageCollection, "Remove" );

// Insert the message at index 0 in the collection.
myOperationMessageCollection->Insert( 0, myInputOperationMessage );

// Display Flow, Input, and Output after inserting.
DisplayFlowInputOutput( myOperationMessageCollection, "Insert" );
myOperationMessageCollection.Remove(myInputOperationMessage);

// Display Flow, Input, and Output after removing.
DisplayFlowInputOutput(myOperationMessageCollection, "Remove");

// Insert the message at index 0 in the collection.
myOperationMessageCollection.Insert(0, myInputOperationMessage);

// Display Flow, Input, and Output after inserting.
DisplayFlowInputOutput(myOperationMessageCollection, "Insert");
myOperationMessageCollection.Remove(myInputOperationMessage)

' Display Flow, Input, and Output after removing.
DisplayFlowInputOutput(myOperationMessageCollection, "Remove")

' Insert the message at index 0 in the collection.
myOperationMessageCollection.Insert(0, myInputOperationMessage)

' Display Flow, Input, and Output after inserting.
DisplayFlowInputOutput(myOperationMessageCollection, "Insert")

Uwagi

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

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

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

Dotyczy