共用方式為


OperationBindingCollection.Remove(OperationBinding) 方法

定義

OperationBinding 中移除指定 OperationBindingCollection 的第一個符合項目。

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

參數

bindingOperation
OperationBinding

要從集合中移除的 OperationBinding

範例

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

// Get the OperationBinding of the Add operation from the collection.
OperationBinding^ myOperationBinding = myOperationBindingCollection[ 3 ];

// Remove the OperationBinding of the Add operation from
// the collection.
myOperationBindingCollection->Remove( myOperationBinding );
Console::WriteLine( "\nRemoved the OperationBinding of the "
"Add operation from the collection." );
// Get the OperationBinding of the Add operation from the collection.
OperationBinding myOperationBinding =
   myOperationBindingCollection[3];

// Remove the OperationBinding of the Add operation from
// the collection.
myOperationBindingCollection.Remove(myOperationBinding);
Console.WriteLine("\nRemoved the OperationBinding of the " +
   "Add operation from the collection.");
' Get the OperationBinding of the Add operation from the collection.
Dim myOperationBinding As OperationBinding = _
   myOperationBindingCollection(3)

' Remove the OperationBinding of the 'Add' operation from
' the collection.
myOperationBindingCollection.Remove(myOperationBinding)
Console.WriteLine(ControlChars.NewLine & _
   "Removed the OperationBinding of the " & _
   "Add operation from the collection.")

備註

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

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

適用於