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

定義

在所有情況下都會擲回 NotSupportedException 例外狀況。Throws a NotSupportedException exception in all cases.

 virtual void System.Collections.Generic.ICollection<TKey>.Clear() = System::Collections::Generic::ICollection<TKey>::Clear;
void ICollection<TKey>.Clear ();
abstract member System.Collections.Generic.ICollection<TKey>.Clear : unit -> unit
override this.System.Collections.Generic.ICollection<TKey>.Clear : unit -> unit
Sub Clear () Implements ICollection(Of TKey).Clear

實作

例外狀況

在所有情況下。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>介面會指定如果執行 Clear NotSupportedException 介面的集合是唯讀的,則方法應該擲回例外狀況。The ICollection<T> interface specifies that the Clear method should throw a NotSupportedException exception if the collection that implements the interface is read-only.

適用於