ActivityCollection.ICollection<Activity>.Remove(Activity) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
從 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> 用於比較金鑰的實作。
在連續元素的集合中,例如列表,緊接被移除元素後的元素會往上移動,佔據空出的位置。 若集合被索引,移動元素的索引也會同步更新。 此行為不適用於將元素概念上分組為桶的集合,例如雜湊表。