Dictionary<TKey,TValue>.ValueCollection.ICollection<TValue>.Remove(TValue) 方法
定义
从 ICollection<T> 中移除特定对象的第一个匹配项。Removes the first occurrence of a specific object from the ICollection<T>. 此实现始终引发 NotSupportedException。This implementation always throws 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> 中删除的对象。The object to remove from the ICollection<T>.
返回
如果从 true
中成功移除 item
,则为 ICollection<T>;否则为 false
。true
if item
was successfully removed from the ICollection<T>; otherwise, false
. 如果在原始 false
中没有找到 item
,此方法也会返回 ICollection<T>。This method also returns false
if item
was not found in the original ICollection<T>.
实现
例外
始终引发。Always thrown.
注解
在如何确定对象是否相等方面这些实现可能存在差异;例如,List<T> 使用 Default,而 Dictionary<TKey,TValue> 允许用户指定 IComparer<T> 实现以用来对键进行比较。Implementations can vary in how they determine equality of objects; for example, List<T> uses Default, whereas, Dictionary<TKey,TValue> allows the user to specify the IComparer<T> implementation to use for comparing keys.