OrderedDictionary.Clear メソッド
アセンブリ: System (system.dll 内)




OrderedDictionary コレクションの変更方法を示すコード例を次に示します。この例では、Clear メソッドを使用して OrderedDictionary を空にした後、OrderedDictionary にデータを読み込みます。このコードは、OrderedDictionary で参照できるコード例の一部です。
' Clear the OrderedDictionary and add new values myOrderedDictionary.Clear() myOrderedDictionary.Add("newKey1", "newValue1") myOrderedDictionary.Add("newKey2", "newValue2") myOrderedDictionary.Add("newKey3", "newValue3") ' Display the contents of the "new" Dictionary Imports an enumerator Dim myEnumerator As IDictionaryEnumerator = _ myOrderedDictionary.GetEnumerator() Console.WriteLine( _ "{0}Displaying the entries of a 'new' OrderedDictionary.", _ Environment.NewLine) DisplayEnumerator(myEnumerator)
// Clear the OrderedDictionary and add new values myOrderedDictionary.Clear(); myOrderedDictionary.Add("newKey1", "newValue1"); myOrderedDictionary.Add("newKey2", "newValue2"); myOrderedDictionary.Add("newKey3", "newValue3"); // Display the contents of the "new" Dictionary using an enumerator IDictionaryEnumerator myEnumerator = myOrderedDictionary.GetEnumerator(); Console.WriteLine( "{0}Displaying the entries of a \"new\" OrderedDictionary." , Environment.NewLine); DisplayEnumerator(myEnumerator);

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からOrderedDictionary.Clear メソッドを検索する場合は、下記のリンクをクリックしてください。

- OrderedDictionary.Clear メソッドのページへのリンク