ReadOnlyDictionary<TKey,TValue>.IDictionary.Clear ReadOnlyDictionary<TKey,TValue>.IDictionary.Clear ReadOnlyDictionary<TKey,TValue>.IDictionary.Clear Method

定義

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

 virtual void System.Collections.IDictionary.Clear() = System::Collections::IDictionary::Clear;
void IDictionary.Clear ();
Sub Clear () Implements IDictionary.Clear

實作

例外狀況

備註

這個成員是明確介面成員實作,This member is an explicit interface member implementation. 只有在 ReadOnlyDictionary<TKey,TValue> 執行個體轉換成 IDictionary 介面時,才能使用這個成員。It can be used only when the ReadOnlyDictionary<TKey,TValue> instance is cast to an IDictionary interface. 介面會指定Clear如果實作為介面的集合NotSupportedException是唯讀的,此方法應該擲回例外狀況。 IDictionaryThe IDictionary interface specifies that the Clear method should throw a NotSupportedException exception if the collection that implements the interface is read-only.

適用於