OperationMessageCollection.Insert(Int32, OperationMessage) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将指定的 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
参数的从零开始的索引。
- 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")
注解
如果集合中的项数已经等于集合的容量,则通过在插入新元素之前自动重新分配内部数组来增加容量。
index
如果参数等于Count,则operationMessage
参数将添加到集合的末尾。
插入点向下移动以容纳新元素的元素。