OperationMessageCollection.Insert(Int32, OperationMessage) Metodo

Definizione

Aggiunge l'oggetto specificato OperationMessage all'oggetto OperationMessageCollection in corrispondenza dell'indice in base zero specificato.

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)

Parametri

index
Int32

Indice in base zero in corrispondenza del quale inserire il operationMessage parametro.

operationMessage
OperationMessage

Oggetto OperationMessage da aggiungere alla raccolta.

Esempio

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

Commenti

Se il numero di elementi nella raccolta è già uguale alla capacità della raccolta, la capacità viene raddoppiata riallocazione automatica della matrice interna prima dell'inserimento del nuovo elemento.

Se il index parametro è uguale a Count, il operationMessage parametro viene aggiunto alla fine della raccolta.

Gli elementi dopo lo spostamento del punto di inserimento verso il basso per contenere il nuovo elemento.

Si applica a