OperationMessageCollection.Remove(OperationMessage) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
從 OperationMessage 中移除指定 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。
範例
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 。
移除 OperationMessage 後的元素會向上移動,以佔用空空的地點。