Export (0) Print
Expand All

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

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft