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

定義

在所有情況下都會擲回 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);
abstract member System.Collections.Generic.ICollection<TKey>.Remove : 'Key -> bool
override this.System.Collections.Generic.ICollection<TKey>.Remove : 'Key -> bool
Function Remove (item As TKey) As Boolean Implements ICollection(Of TKey).Remove

參數

item
TKey

要從集合中移除的物件。The object to remove from the collection.

傳回

Boolean

如果已順利從集合中移除 item 則為 true,否則為 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.

實作

例外狀況

在所有情況下。In all cases.

備註

這個成員是明確介面成員實作,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. ICollection<T>介面會指定如果執行 Remove NotSupportedException 介面的集合是唯讀的,則方法應該擲回例外狀況。The ICollection<T> interface specifies that the Remove method should throw a NotSupportedException exception if the collection that implements the interface is read-only.

適用於