ResXResourceReaderGetEnumerator Method

Returns an IDictionaryEnumerator instance for the current ResXResourceReader object that enumerates the resources in the source XML resource file or stream.

Definition

Namespace: KGySoft.Resources
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
C#
public IDictionaryEnumerator GetEnumerator()

Return Value

IDictionaryEnumerator
An IDictionaryEnumerator for that can be used to iterate through the resources from the current XML resource file or stream.

Implements

IResourceReaderGetEnumerator

Remarks

In System.Resources.ResXResourceReader if UseResXDataNodes property is , the resource and metadata entries are mixed in the returned enumerator, while when it is , then only the resources are returned. In this ResXResourceReader implementation the GetEnumerator method always returns only the resources and GetMetadataEnumerator returns the metadata regardless of the value of the UseResXDataNodes or SafeMode properties.

If the SafeMode property is , the IDictionaryEnumerator.Value property of the returned enumerator is a ResXDataNode instance rather than the resource value. This makes possible to check the raw .resx content before deserialization if the .resx file is from an untrusted source. See also the example at ResXDataNode.

If AllowDuplicatedKeys property is , then this method returns a lazy enumerator for the first time meaning the .resx file is parsed only during the enumeration. When any of the enumerators are obtained for the second time, a cached enumerator is returned with the whole parsed .resx content. If duplicates are disabled, the lastly defined value will be returned of a redefined name.

See also the Remarks section of the ResXResourceReader class for examples.

See Also