OperationMessageCollection.Insert(Int32, OperationMessage) Método

Definição

Soma o especificado OperationMessage ao OperationMessageCollection no índice baseado em zero especificado.

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)

Parâmetros

index
Int32

O índice baseado em zero a partir do qual inserir o operationMessage parâmetro.

operationMessage
OperationMessage

A OperationMessage acrescentar à coleção.

Exemplos

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")

Observações

Se o número de itens na coleção já for igual à capacidade da coleção, a capacidade é duplicada ao realocar automaticamente o array interno antes de o novo elemento ser inserido.

Se o index parâmetro for igual a Count, o operationMessage parâmetro é adicionado ao final da coleção.

Os elementos após o ponto de inserção descem para acomodar o novo elemento.

Aplica-se a