ReadOnlyDictionary<TKey,TValue>.IDictionary.Clear 方法

定义

在所有情况下都会引发 NotSupportedException 异常。Throws a NotSupportedException exception in all cases.

 virtual void System.Collections.IDictionary.Clear() = System::Collections::IDictionary::Clear;
void IDictionary.Clear ();
abstract member System.Collections.IDictionary.Clear : unit -> unit
override this.System.Collections.IDictionary.Clear : unit -> unit
Sub Clear () Implements IDictionary.Clear

实现

例外

在所有情况下。In all cases.

注解

此成员是显式接口成员的实现。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. IDictionary接口指定在 Clear 实现接口的集合为只读时,方法应引发 NotSupportedException 异常。The IDictionary interface specifies that the Clear method should throw a NotSupportedException exception if the collection that implements the interface is read-only.

适用于