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

定義

在所有情況下都會擲回 NotSupportedException 例外狀況。

 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

要從集合中移除的物件。

傳回

如果已順利從集合中移除 item 則為 true,否則為 false。 如果在原始集合中找不到 item,則這個方法也會傳回 false

實作

例外狀況

在所有情況下。

備註

這個成員是明確介面成員實作, 只有在 ReadOnlyDictionary<TKey,TValue>.KeyCollection 執行個體轉換成 ICollection<T> 介面時,才能使用這個成員。 如果 ICollection<T> 實作介面的集合是只讀的,介面會 Remove 指定 方法應該擲回 NotSupportedException 例外狀況。

適用於