DictionaryEntry コンストラクタ
アセンブリ: mscorlib (mscorlib.dll 内)



.NET Framework 2.0 の場合、key が null 参照 (Visual Basic では Nothing) になることがあります。

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


DictionaryEntry プロパティ


関連項目
DictionaryEntry 構造体System.Collections 名前空間
IDictionary
IDictionaryEnumerator
System.Collections.Generic.KeyValuePair
DictionaryEntry メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 ( ValueType から継承されます。) |
![]() | GetHashCode | このインスタンスのハッシュ コードを返します。 ( ValueType から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | このインスタンスの完全修飾型名を返します。 ( ValueType から継承されます。) |

関連項目
DictionaryEntry 構造体System.Collections 名前空間
IDictionary
IDictionaryEnumerator
System.Collections.Generic.KeyValuePair
DictionaryEntry メンバ
設定または取得できる、ディクショナリのキー/値ペアを定義します。
DictionaryEntry データ型で公開されるメンバを以下の表に示します。



名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 ( ValueType から継承されます。) |
![]() | GetHashCode | このインスタンスのハッシュ コードを返します。 (ValueType から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | このインスタンスの完全修飾型名を返します。 (ValueType から継承されます。) |

関連項目
DictionaryEntry 構造体System.Collections 名前空間
IDictionary
IDictionaryEnumerator
System.Collections.Generic.KeyValuePair
DictionaryEntry 構造体
アセンブリ: mscorlib (mscorlib.dll 内)


IDictionaryEnumerator.Entry メソッドは、この型のインスタンスを返します。
C# 言語の foreach ステートメント (Visual C++ の場合は for each、Visual Basic の場合は For Each) は、コレクション内の各要素の型を必要とします。IDictionary の各要素はキー/値ペアであるため、要素の型は、キーの型や値の型にはなりません。その代わり、要素の型は DictionaryEntry になります。例 :
foreach ステートメントは、列挙子のラッパーです。これは、コレクションからの読み取りのみを許可し、コレクションへの書き込みを防ぎます。

DictionaryEntry を使用して Hashtable オブジェクトを反復処理する例を次に示します。
'A simple example for the DictionaryEntry structure. Imports System Imports System.Collections Imports Microsoft.VisualBasic Module Example Sub Main() ' Create a new hash table. ' Dim openWith As New Hashtable() ' Add some elements to the hash table. There are no ' duplicate keys, but some of the values are duplicates. openWith.Add("txt", "notepad.exe") openWith.Add("bmp", "paint.exe") openWith.Add("dib", "paint.exe") openWith.Add("rtf", "wordpad.exe") ' When you use For Each to enumerate hash table elements, ' the elements are retrieved as KeyValuePair objects. Console.WriteLine() For Each de As DictionaryEntry In openWith Console.WriteLine("Key = {0}, Value = {1}", _ de.Key, de.Value) Next de End Sub End Module ' This code example produces output similar to the following: ' 'Key = rtf, Value = winword.exe 'Key = txt, Value = notepad.exe 'Key = dib, Value = paint.exe 'Key = bmp, Value = paint.exe
// A simple example for the DictionaryEntry structure. using System; using System.Collections; class Example { public static void Main() { // Create a new hash table. // Hashtable openWith = new Hashtable(); // Add some elements to the hash table. There are no // duplicate keys, but some of the values are duplicates. openWith.Add("txt", "notepad.exe"); openWith.Add("bmp", "paint.exe"); openWith.Add("dib", "paint.exe"); openWith.Add("rtf", "wordpad.exe"); // When you use foreach to enumerate hash table elements, // the elements are retrieved as KeyValuePair objects. Console.WriteLine(); foreach (DictionaryEntry de in openWith) { Console.WriteLine("Key = {0}, Value = {1}", de.Key, de.Value); } } } /* This code example produces output similar to the following: Key = rtf, Value = wordpad.exe Key = txt, Value = notepad.exe Key = dib, Value = paint.exe Key = bmp, Value = paint.exe */


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


DictionaryEntry メンバ
System.Collections 名前空間
IDictionary
IDictionaryEnumerator
System.Collections.Generic.KeyValuePair
Weblioに収録されているすべての辞書からDictionaryEntryを検索する場合は、下記のリンクをクリックしてください。

- DictionaryEntryのページへのリンク