OrderedDictionary.GetEnumerator メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > OrderedDictionary.GetEnumerator メソッドの意味・解説 

OrderedDictionary.GetEnumerator メソッド

メモ : このメソッドは、.NET Framework version 2.0新しく追加されたものです。

OrderedDictionary コレクション反復処理する IDictionaryEnumerator オブジェクト返します

名前空間: System.Collections.Specialized
アセンブリ: System (system.dll 内)
構文構文

Public Overridable Function
 GetEnumerator As IDictionaryEnumerator
Dim instance As OrderedDictionary
Dim returnValue As IDictionaryEnumerator

returnValue = instance.GetEnumerator
public virtual IDictionaryEnumerator GetEnumerator ()
public:
virtual IDictionaryEnumerator^ GetEnumerator ()
public IDictionaryEnumerator GetEnumerator ()
public function GetEnumerator () : IDictionaryEnumerator

戻り値
OrderedDictionary コレクションIDictionaryEnumerator オブジェクト

解説解説
使用例使用例

GetEnumerator メソッド使用して OrderedDictionary コレクション内容コンソール出力する方法次のコード例示します。この例では、GetEnumerator メソッド使用して内容表示するメソッド渡される IDictionaryEnumerator オブジェクト取得します。このコードは、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);
' Displays the contents of the OrderedDictionary using its enumerator
Public Shared Sub DisplayEnumerator(
 _
    ByVal myEnumerator As IDictionaryEnumerator)

    Console.WriteLine("   KEY                       VALUE")
    While myEnumerator.MoveNext()
        Console.WriteLine("   {0,-25} {1}", _
            myEnumerator.Key, myEnumerator.Value)
    End While
End Sub
// Displays the contents of the OrderedDictionary using its enumerator
public static void DisplayEnumerator(IDictionaryEnumerator
 myEnumerator)
{
    Console.WriteLine("   KEY                       VALUE");
    while (myEnumerator.MoveNext())
    {
        Console.WriteLine("   {0,-25} {1}",
            myEnumerator.Key, myEnumerator.Value);
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
OrderedDictionary クラス
OrderedDictionary メンバ
System.Collections.Specialized 名前空間


このページでは「.NET Framework クラス ライブラリ リファレンス」からOrderedDictionary.GetEnumerator メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からOrderedDictionary.GetEnumerator メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からOrderedDictionary.GetEnumerator メソッド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

OrderedDictionary.GetEnumerator メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



OrderedDictionary.GetEnumerator メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS