System.Collections.IDictionaryEnumerator Interface

public interface IDictionaryEnumerator : IEnumerator

Base Types

This type implements IEnumerator.

Assembly

mscorlib

Library

BCL

Summary

Implemented by classes that support the use of an enumerator over a dictionary (i.e., a collection of DictionaryEntry objects).

Description

[Note: IDictionaryEnumerator contains members that get the properties of DictionaryEntry objects.

For detailed information regarding the use of an enumerator, see IEnumerator.

]

See Also

System.Collections Namespace

Members

IDictionaryEnumerator Properties

IDictionaryEnumerator.Entry Property
IDictionaryEnumerator.Key Property
IDictionaryEnumerator.Value Property


IDictionaryEnumerator.Entry Property

DictionaryEntry Entry { get; }

Summary

Gets the DictionaryEntry in the collection over which the current instance is positioned.

Property Value

The DictionaryEntry in the collection over which the current instance is positioned.

Exceptions

Exception TypeCondition
InvalidOperationExceptionThe IDictionaryEnumerator is positioned before the first element of the dictionary or after the last element.

-or-

The dictionary was modified after the IDictionaryEnumerator was created.

Description

This property is read-only.

[Behaviors: It is required that a call to System.Collections.IDictionaryEnumerator.Entry leave the position of the enumerator unchanged: consecutive calls to this property are required to return the same Object until System.Collections.IEnumerator.MoveNext or System.Collections.IEnumerator.Reset is called.]

[Usage: Use System.Collections.IDictionaryEnumerator.Entry to get the same data that would be provided by a call to System.Collections.IEnumerator.Current. Because this property is a DictionaryEntry, boxing is not required as it is for System.Collections.IEnumerator.Current; therefore, for this operation, System.Collections.IDictionaryEnumerator.Entry has reduced overhead compared to System.Collections.IEnumerator.Current.]

See Also

System.Collections.IDictionaryEnumerator Interface, System.Collections Namespace

IDictionaryEnumerator.Key Property

object Key { get; }

Summary

Gets the System.Collections.DictionaryEntry.Key of the DictionaryEntry in the collection over which the current instance is positioned.

Property Value

A Object that contains the System.Collections.DictionaryEntry.Key of the DictionaryEntry in the collection over which the current instance is positioned.

Exceptions

Exception TypeCondition
InvalidOperationExceptionThe 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.

Description

This property is read-only.

[Behaviors: It is required that reading System.Collections.IDictionaryEnumerator.Key leave the position of the enumerator unchanged: consecutive calls to this property are required to return the same Object until System.Collections.IEnumerator.MoveNext or System.Collections.IEnumerator.Reset is called.]

See Also

System.Collections.IDictionaryEnumerator Interface, System.Collections Namespace

IDictionaryEnumerator.Value Property

object Value { get; }

Summary

Gets the System.Collections.DictionaryEntry.Value of the DictionaryEntry in the collection over which the current instance is positioned.

Property Value

A Object that contains the System.Collections.DictionaryEntry.Value of the DictionaryEntry in the collection over which the current instance is positioned.

Exceptions

Exception TypeCondition
InvalidOperationExceptionThe IDictionaryEnumerator is positioned before the first element of the dictionary or after the last element.

-or-

The dictionary was modified after the IDictionaryEnumerator was created.

Description

This property is read-only.

[Behaviors: It is required that a call to System.Collections.IDictionaryEnumerator.Value leave the position of the enumerator unchanged: consecutive calls to this property are required to return the same Object until System.Collections.IEnumerator.MoveNext or System.Collections.IEnumerator.Reset is called.]

See Also

System.Collections.IDictionaryEnumerator Interface, System.Collections Namespace