ReadOnlyDictionary<TKey,TValue>.KeyCollection.ICollection<TKey>.Remove(TKey) ReadOnlyDictionary<TKey,TValue>.KeyCollection.ICollection<TKey>.Remove(TKey) ReadOnlyDictionary<TKey,TValue>.KeyCollection.ICollection<TKey>.Remove(TKey) Method

定义

任何情况下均引发 NotSupportedException 异常。Throws a NotSupportedException exception in all cases.

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

参数

item
TKey TKey TKey

要从集合中移除的对象。The object to remove from the collection.

返回

如果从集合中成功移除了 true,则为 item;否则为 falsetrue if item was successfully removed from the collection; otherwise, false. 如果在原始集合中找不到 item,此方法也会返回 falseThis method also returns false if item is not found in the original collection.

实现

异常

注解

此成员是显式接口成员的实现。This member is an explicit interface member implementation. 它只能在 ReadOnlyDictionary<TKey,TValue>.KeyCollection 实例被强制转换为 ICollection<T> 接口时使用。It can be used only when the ReadOnlyDictionary<TKey,TValue>.KeyCollection instance is cast to an ICollection<T> interface. 接口指定在Remove实现接口的集合为只读NotSupportedException时, 方法应引发异常。 ICollection<T>The ICollection<T> interface specifies that the Remove method should throw a NotSupportedException exception if the collection that implements the interface is read-only.

适用于