語言

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 的元素會往上移動,佔據空出的位置。

適用於