DictionaryEntry Structure
Defines a dictionary key/value pair that can be set or retrieved.
Namespace: System.Collections
Assembly: mscorlib (in mscorlib.dll)
The DictionaryEntry type exposes the following members.
| Name | Description | |
|---|---|---|
![]() ![]() ![]() ![]() | DictionaryEntry | Initializes an instance of the DictionaryEntry type with the specified key and value. |
| Name | Description | |
|---|---|---|
![]() ![]() ![]() ![]() | Equals | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.) |
![]() ![]() ![]() ![]() | GetHashCode | Returns the hash code for this instance. (Inherited from ValueType.) |
![]() ![]() ![]() ![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() ![]() | ToString | Returns the fully qualified type name of this instance. (Inherited from ValueType.) In XNA Framework 3.0, this member is inherited from Object.ToString(). |
The IDictionaryEnumerator.Entry method returns an instance of this type.
The foreach statement of the C# language (for each in Visual C++, For Each in Visual Basic) requires the type of each element in the collection. Since each element of the IDictionary is a key/value pair, the element type is not the type of the key or the type of the value. Instead, the element type is DictionaryEntry. For example:
The foreach statement is a wrapper around the enumerator, which only allows reading from, not writing to, the collection.
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
.gif?cs-save-lang=1&cs-lang=fsharp)
.gif?cs-save-lang=1&cs-lang=fsharp)
.png?cs-save-lang=1&cs-lang=fsharp)
.png?cs-save-lang=1&cs-lang=fsharp)
.gif?cs-save-lang=1&cs-lang=fsharp)