共用方式為


OperationCollection.Remove(Operation) 方法

定義

Operation 中移除指定 OperationCollection 的第一個符合項目。

public:
 void Remove(System::Web::Services::Description::Operation ^ operation);
public void Remove (System.Web.Services.Description.Operation operation);
member this.Remove : System.Web.Services.Description.Operation -> unit
Public Sub Remove (operation As Operation)

參數

operation
Operation

要從集合中移除的 Operation

範例

下列範例示範 Remove 方法的用法。

myOperationCollection->Remove( myOperation );

// Insert the 'myOpearation' operation at the index '0'.
myOperationCollection->Insert( 0, myOperation );
Console::WriteLine( "The operation at index '0' is : {0}", myOperationCollection[ 0 ]->Name );
myOperationCollection.Remove(myOperation);
// Insert the 'myOpearation' operation at the index '0'.
myOperationCollection.Insert(0, myOperation);
Console.WriteLine("The operation at index '0' is : " +
                  myOperationCollection[0].Name);
myOperationCollection.Remove(myOperation)
' Insert the 'myOpearation' operation at the index '0'.
myOperationCollection.Insert(0, myOperation)
Console.WriteLine("The operation at index '0' is : " + _
                  myOperationCollection.Item(0).Name)

備註

這個方法會執行線性搜尋;因此,平均執行時間與 成正比 Count

移除 Operation 後的元素會向上移動,以佔用空空的地點。

適用於