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

定義

ICollection<T> 中移除所有項目。 這個實作一律會擲回 NotSupportedException

 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

實作

例外狀況

一律擲回;這個集合是唯讀的。

備註

屬性 Count 會設定為 0,而且也會釋放集合元素中其他對象的參考。

適用於

另請參閱