Freigeben über


IDictionary.Clear-Methode

Entfernt alle Elemente aus dem IDictionary-Objekt.

Namespace: System.Collections
Assembly: mscorlib (in mscorlib.dll)

Syntax

'Declaration
Sub Clear
'Usage
Dim instance As IDictionary

instance.Clear
void Clear ()
void Clear ()
void Clear ()
function Clear ()

Ausnahmen

Ausnahmetyp Bedingung

NotSupportedException

Das IDictionary-Objekt ist schreibgeschützt.

Beispiel

Das folgende Codebeispiel veranschaulicht das Implementieren der Clear-Methode. Dieses Codebeispiel ist Teil eines umfangreicheren Beispiels für die IDictionary-Klasse.

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

Plattformen

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

.NET Compact Framework

Unterstützt in: 2.0, 1.0

Siehe auch

Referenz

IDictionary-Schnittstelle
IDictionary-Member
System.Collections-Namespace