ActivityCollection.ICollection<Activity>.Remove(Activity) 方法

定義

ICollection<T> 移除特定物件之第一個符合的元素。

 virtual bool System.Collections.Generic.ICollection<System.Workflow.ComponentModel.Activity>.Remove(System::Workflow::ComponentModel::Activity ^ item) = System::Collections::Generic::ICollection<System::Workflow::ComponentModel::Activity ^>::Remove;
bool ICollection<Activity>.Remove (System.Workflow.ComponentModel.Activity item);
abstract member System.Collections.Generic.ICollection<System.Workflow.ComponentModel.Activity>.Remove : System.Workflow.ComponentModel.Activity -> bool
override this.System.Collections.Generic.ICollection<System.Workflow.ComponentModel.Activity>.Remove : System.Workflow.ComponentModel.Activity -> bool
Function Remove (item As Activity) As Boolean Implements ICollection(Of Activity).Remove

參數

item
Activity

要從 ICollection<T> 移除的物件。

傳回

如果 true 已成功從 item 中移除,則為 ICollection<T>,否則為 false。 如果在原本的 false 中找不到 item,則這個方法也會傳回 ICollection<T>

實作

例外狀況

ICollection 為唯讀。

備註

實作依判斷物件相等的方法會有所不同;例如,List<T> 使用 Default,而 Dictionary<TKey,TValue> 則讓使用者指定要用來比較索引鍵的 IComparer<T> 實作。

在相鄰元素的集合中,例如清單,接在移除的元素之後的元素會向上移動以佔用空出的位置。 如果集合具有索引,則移動之項目的索引也會更新。 集合的項目若在概念上群組成 Bucket (例如雜湊資料表),則不適用這項行為。

適用於