NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

IDictionaryEnumerator.Key

When implemented by a class, retrieves the key of the current dictionary entry.

[Visual Basic]
ReadOnly Property Key As Object
[C#]
object Key {get;}
[C++]
Object* get_Key() = 0;
[JScript]
abstract function get Key() : Object;

Property Value

The key of the current element of the enumeration.

Exceptions

Exception Type Condition
InvalidOperationException The IDictionaryEnumerator is positioned before the first entry of the dictionary or after the last entry.

-or-

The dictionary is modified after the IDictionaryEnumerator was created.

Remarks

After an enumerator is created or after a call to Reset, MoveNext must be called to advance the enumerator to the first entry of the dictionary before calling the Key method.

Key will also throw an exception if the last call to MoveNext returned false which indicates the end of the collection.

Key does not move the position of the enumerator and multiple calls to Key will return the same object until either MoveNext or Reset is called.

See Also

IDictionaryEnumerator Interface | IDictionaryEnumerator Members | System.Collections Namespace | Reset | MoveNext | Value