OperationMessageCollection.Insert(Int32, OperationMessage) メソッド

定義

指定した 0 から始まるインデックス番号にある OperationMessage に、指定した OperationMessageCollection を追加します。

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)

パラメーター

index
Int32

operationMessage パラメーターを挿入する位置の、0 から始まるインデックス番号。

operationMessage
OperationMessage

コレクションに追加する OperationMessage

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

注釈

コレクション内の項目の数が既にコレクションの容量と等しい場合、新しい要素が挿入される前に内部配列を自動的に再割り当てすることで、容量が 2 倍になります。

パラメーターが index 等しい Count場合、 operationMessage パラメーターはコレクションの末尾に追加されます。

挿入ポイントの後の要素は、新しい要素に合わせて下に移動します。

適用対象