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

定義

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

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

實作

例外狀況

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

備註

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

適用於

另請參閱