Compartilhar via


OperationMessageCollection.Insert(Int32, OperationMessage) Método

Definição

Adiciona o OperationMessage especificado ao OperationMessageCollection no índice de base 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 de base zero no qual inserir o parâmetro operationMessage.

operationMessage
OperationMessage

O OperationMessage a adicionar à 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")

Comentários

Se o número de itens na coleção já for igual à capacidade da coleção, a capacidade será dobrada realocando automaticamente a matriz interna antes que o novo elemento seja inserido.

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

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

Aplica-se a