SortedDictionary<TKey,TValue>.ValueCollection.ICollection<TValue>.Remove 方法

定義

ICollection<T> 移除特定物件之第一個符合的元素。 這個實作一律會擲回 NotSupportedException

 virtual bool System.Collections.Generic.ICollection<TValue>.Remove(TValue item) = System::Collections::Generic::ICollection<TValue>::Remove;
bool ICollection<TValue>.Remove (TValue item);
abstract member System.Collections.Generic.ICollection<TValue>.Remove : 'Value -> bool
override this.System.Collections.Generic.ICollection<TValue>.Remove : 'Value -> bool
Function Remove (item As TValue) As Boolean Implements ICollection(Of TValue).Remove

參數

item
TValue

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

傳回

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

實作

例外狀況

一律擲回;這個集合是唯讀的。

備註

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

適用於

另請參閱