A object that contains the DictionaryEntry.Key of the DictionaryEntry in the collection over which the current instance is positioned.
Type Reason InvalidOperationException The IDictionaryEnumerator is positioned before the first element of the dictionary or after the last element.
-or-
The dictionary was modified after the IDictionaryEnumerator was instantiated.
After an enumerator is created or after the IEnumerator.Reset method is called, the IEnumerator.MoveNext method must be called to advance the enumerator to the first element of the collection before reading the value of the IDictionaryEnumerator.Key property; otherwise, IDictionaryEnumerator.Key is undefined.
IDictionaryEnumerator.Key also throws an exception if the last call to IEnumerator.MoveNext returned false, which indicates the end of the collection.
IDictionaryEnumerator.Key does not move the position of the enumerator, and consecutive calls to IDictionaryEnumerator.Key return the same object until either IEnumerator.MoveNext or IEnumerator.Reset is called.