OperationMessageCollection.Insert(Int32, OperationMessage) Metod

Definition

Lägger till OperationMessage det angivna OperationMessageCollection i det angivna nollbaserade indexet.

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)

Parametrar

index
Int32

Det nollbaserade index där parametern ska infogas operationMessage .

operationMessage
OperationMessage

Att OperationMessage lägga till i samlingen.

Exempel

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

Kommentarer

Om antalet objekt i samlingen redan är lika med samlingens kapacitet, fördubblas kapaciteten genom att den interna matrisen omplaceras automatiskt innan det nya elementet infogas.

Om parametern index är lika med Countläggs parametern operationMessage till i slutet av samlingen.

Elementen efter insättningspunkten flyttas ned för att rymma det nya elementet.

Gäller för