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> 使用 Default,而 SortedDictionary<TKey,TValue> 允许用户指定 IComparer<T> 用于比较键的实现。

适用于

另请参阅