System.Collections Namespace
Defines a dictionary key-and-value pair that can be set or retrieved.
Visibility |
Name |
Value Type |
Accessibility |
public |
Key
|
Object |
[ Get , Set ] |
public |
Value
|
Object |
[ Get , Set ] |
|
The IDictionaryEnumerator.Entry method returns an instance of this class.
The foreach statement of the C# language (for each ...next in Visual Basic) requires the type of each element in the collection. Since each element of a collection based on IDictionary is a key-and-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:
foreach ( DictionaryEntry myEntry in myHashtable ) {
...
}
for each myEntry as DictionaryEntry in myHashtable
...
next |
|
C# |
VB |