ResXResourceReader.GetMetadataEnumerator Method ()


Provides a dictionary enumerator that can retrieve the design-time properties from the current XML resource file or stream.

Namespace:   System.Resources
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public IDictionaryEnumerator GetMetadataEnumerator()

Return Value

Type: System.Collections.IDictionaryEnumerator

An enumerator for the metadata in a resource.

Resources are stored as name/value pairs in a resource file or stream. Design-time properties, which are called metadata, are stored in the resource file or stream along with runtime data resources. The GetMetadataEnumerator method provides an IDictionaryEnumerator object that can retrieve the metadata from the resource file or stream associated with the current ResXResourceReader object. However, if the UseResXDataNodes property is set to true before you call GetMetadataEnumerator, no resource nodes are retrieved.

The following example uses the GetMetadataEnumerator method to iterate through the metadata resources in an XML resource file. This code example is part of a larger example provided for the UseResXDataNodes property.

// Enumerate using GetMetadataEnumerator()
IDictionaryEnumerator metadataEnumerator = reader.GetMetadataEnumerator();

Console.WriteLine("\n  MetadataEnumerator:");
while (metadataEnumerator.MoveNext())
    ShowResourceItem(metadataEnumerator.Entry, useDataNodes);

.NET Framework
Available since 2.0
Return to top