OperationMessageCollection.Remove(OperationMessage) 方法
定义
从 OperationMessage 中移除指定的 OperationMessageCollection 的第一个匹配项。Removes the first occurrence of the specified OperationMessage from the OperationMessageCollection.
public:
void Remove(System::Web::Services::Description::OperationMessage ^ operationMessage);
public void Remove (System.Web.Services.Description.OperationMessage operationMessage);
member this.Remove : System.Web.Services.Description.OperationMessage -> unit
Public Sub Remove (operationMessage As OperationMessage)
参数
- operationMessage
- OperationMessage
要从该集合中移除的 OperationMessage。The OperationMessage to remove from the collection.
示例
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")
注解
此方法执行线性搜索;因此,平均执行时间与成正比 Count 。This method performs a linear search; therefore, the average execution time is proportional to Count.
跟随删除的元素 OperationMessage 上移以占据空出的位置。The elements that follow the removed OperationMessage move up to occupy the vacated spot.