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!

Dictionary.GetEnumerator

Returns an enumerator which can be used to iterate through the Dictionary.

[Visual Basic]
Overridable Public Function GetEnumerator() As IDictionaryEnumerator
[C#]
public virtual IDictionaryEnumerator GetEnumerator();
[C++]
public: virtual IDictionaryEnumerator* GetEnumerator();
[JScript]
public function GetEnumerator() : IDictionaryEnumerator;

Return Value

An IDictionaryEnumerator for the Dictionary.

Remarks

This method can be overridden by a derived class.

The enumerator does not have exclusive access to the Dictionary; therefore, any changes made to the Dictionary may cause Current or MoveNext to throw an exception.

Removing objects from the enumerator will remove them from the Dictionary.

An IDictionaryEnumerator can also be obtained by casting. Subclasses of the Dictionary class guarantee to return an IDictionaryEnumerator. This is a convenient method of calling the overloaded version of GetEnumerator that takes a Boolean parameter to specify whether the enumeration support entry removal. Note that that version of GetEnumerator must be implemented for this method to work.

Example

Dictionary d = //...
DictionaryEnumerator e = (DictionaryEnumerator) d.GetEnumerator();

See Also

Dictionary Class | Dictionary Members | System.Collections Namespace | IDictionaryEnumerator | IEnumerator