IDictionary.Clear IDictionary.Clear IDictionary.Clear IDictionary.Clear Method

定義

將所有項目從 IDictionary 物件移除。Removes all elements from the IDictionary object.

public:
 void Clear();
public void Clear ();
abstract member Clear : unit -> unit
Public Sub Clear ()

例外狀況

範例

下列程式碼範例示範如何實作Clear方法。The following code example demonstrates how to implement the Clear method. 此程式碼範例是針對提供之較大範例的一部分IDictionary類別。This code example is part of a larger example provided for the IDictionary class.

public:
    virtual void Clear()
    {
        itemsInUse = 0;
    }
public void Clear() { ItemsInUse = 0; }
Public Sub Clear() Implements IDictionary.Clear
    ItemsInUse = 0
End Sub

適用於