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

定义

ICollection<T> 中移除特定对象的第一个匹配项。Removes the first occurrence of a specific object from the ICollection<T>. 此实现始终引发 NotSupportedExceptionThis implementation always throws a NotSupportedException.

 virtual bool System.Collections.Generic.ICollection<TValue>.Remove(TValue item) = System::Collections::Generic::ICollection<TValue>::Remove;
bool ICollection<TValue>.Remove (TValue item);
Function Remove (item As TValue) As Boolean Implements ICollection(Of TValue).Remove

参数

item
TValue

要从 ICollection<T> 中删除的对象。The object to remove from the ICollection<T>.

返回

如果已从 ICollection<T> 中成功删除 item,则为 true;否则为 falsetrue if item is successfully removed from the ICollection<T>; otherwise, false. 如果在 false 中没有找到 item,则此方法也会返回 ICollection<T>This method also returns false if item is not found in the ICollection<T>.

实现

异常

总是引发;集合为只读。Always thrown; the collection is read-only.

注解

实现在确定对象的相等性方面可能有所不同;例如,List<T> 使用 Default,而 SortedDictionary<TKey,TValue> 允许用户指定要用于比较键的 @no__t 3 实现。Implementations can vary in how they determine equality of objects; for example, List<T> uses Default, whereas SortedDictionary<TKey,TValue> allows the user to specify the IComparer<T> implementation to use for comparing keys.

适用于

另请参阅