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 元素向上移动以占据空置的位置。

适用于