ResXResourceReader.GetMetadataEnumerator Method

Definition

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

C#
public System.Collections.IDictionaryEnumerator GetMetadataEnumerator();

Returns

An enumerator for the metadata in a resource.

Examples

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.

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

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

Remarks

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.

Applies to

Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10