KGy SOFT

AutoAppendOptions Enumeration

KGy SOFT Core Libraries Help
Represents the resource auto append options of a DynamicResourceManager instance. These options are ignored if Source is CompiledOnly.

Namespace:  KGySoft.Resources
Assembly:  KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 5.0.0-rc.1
Syntax

[FlagsAttribute]
public enum AutoAppendOptions
Members

  Member nameValueDescription
None0 Represents no auto appending.
AddUnknownToInvariantCulture1

If a resource with an unknown key is requested, a new resource is automatically added to the invariant resource set.

If the resource is requested as a String, the newly added value will be initialized by the requested key, prefixed by the LanguageSettings.UnknownResourcePrefix property. This new entry can be then merged into other resource sets, too.

If the resource is requested as an Object, a  value will be added to the resource. The  value is never merged into the other resource sets because it has a special meaning: if a resource has a null value, the parent resources are checked for a non-null resource value.

Enabling this flag causes that MissingManifestResourceException will never be thrown for non-existing resources.

This option is disabled by default.

AppendFirstNeutralCulture2

If a resource is found in a parent resource set of the requested culture, and the traversal of the culture hierarchy hits a neutral culture, then the resource set of the first (most derived) neutral culture will be automatically appended by the found resource.
Let's consider the following hypothetical culture hierarchy:
en-Runic-GB-Yorkshire (specific) -> en-Runic-GB (specific) -> en-Runic (neutral) -> en (neutral) -> Invariant
If the requested culture is en-Runic-GB-Yorkshire and the resource is found in the invariant resource set, then with this option the found resource will be added to the en-Runic resource set.

If the found resource is a String, the newly added value will be prefixed by the LanguageSettings.UntranslatedResourcePrefix property.

If the found non- resource is not a String, the found value will be simply copied.

This option is enabled by default.

AppendLastNeutralCulture4

If a resource is found in the resource set of the invariant culture, then the resource set of the last neutral culture (whose parent is the invariant culture) will be automatically appended by the found resource.
Let's consider the following hypothetical culture hierarchy:
en-Runic-GB-Yorkshire (specific) -> en-Runic-GB (specific) -> en-Runic (neutral) -> en (neutral) -> Invariant
If the requested culture is en-Runic-GB-Yorkshire and the resource is found in the invariant resource set, then with this option the found resource will be added to the en resource set.

If the found resource is a String, the newly added value will be prefixed by the LanguageSettings.UntranslatedResourcePrefix property.

If the found non- resource is not a String, the found value will be simply copied.

This option is disabled by default.

AppendNeutralCultures14

If a resource is found in a parent resource set of the requested culture, and the traversal of the culture hierarchy hits neutral cultures, then the resource sets of the neutral cultures will be automatically appended by the found resource.
Let's consider the following hypothetical culture hierarchy:
en-Runic-GB-Yorkshire (specific) -> en-Runic-GB (specific) -> en-Runic (neutral) -> en (neutral) -> Invariant
If the requested culture is en-Runic-GB-Yorkshire and the resource is found in the invariant resource set, then with this option the found resource will be added to the en and en-Runic resource sets.

If the found resource is a String, the newly added value will be prefixed by the LanguageSettings.UntranslatedResourcePrefix property.

If the found non- resource is not a String, the found value will be simply copied.

This option includes AppendFirstNeutralCulture and AppendLastNeutralCulture options.

This option is disabled by default.

AppendFirstSpecificCulture16

If a resource is found in a parent resource set of the requested specific culture, then the resource set of the requested culture will be automatically appended by the found resource.
Let's consider the following hypothetical culture hierarchy:
en-Runic-GB-Yorkshire (specific) -> en-Runic-GB (specific) -> en-Runic (neutral) -> en (neutral) -> Invariant
If the requested culture is en-Runic-GB-Yorkshire and the resource is found in one of its parents, then with this option the found resource will be added to the requested en-Runic-GB-Yorkshire resource set.

If the found resource is a String, the newly added value will be prefixed by the LanguageSettings.UntranslatedResourcePrefix property.

If the found non- resource is not a String, the found value will be simply copied.

This option is disabled by default.

AppendLastSpecificCulture32

If a resource is found in a parent resource set of the requested specific culture, then the resource set of the last specific culture in the traversal hierarchy (whose parent is a non-specific culture) will be automatically appended by the found resource.
Let's consider the following hypothetical culture hierarchy:
en-Runic-GB-Yorkshire (specific) -> en-Runic-GB (specific) -> en-Runic (neutral) -> en (neutral) -> Invariant
If the requested culture is en-Runic-GB-Yorkshire and the resource is found in the invariant resource set, then with this option the found resource will be added to the en-Runic-GB resource set.

If the found resource is a String, the newly added value will be prefixed by the LanguageSettings.UntranslatedResourcePrefix property.

If the found non- resource is not a String, the found value will be simply copied.

This option is disabled by default.

AppendSpecificCultures112

If a resource is found in a parent resource set of the requested specific culture, then the resource sets of the visited specific cultures will be automatically appended by the found resource.
Let's consider the following hypothetical culture hierarchy:
en-Runic-GB-Yorkshire (specific) -> en-Runic-GB (specific) -> en-Runic (neutral) -> en (neutral) -> Invariant
If the requested culture is en-Runic-GB-Yorkshire and the resource is found in the invariant resource set, then with this option the found resource will be added to the en-Runic-GB-Yorkshire and en-Runic-GB resource sets.

If the found resource is a String, the newly added value will be prefixed by the LanguageSettings.UntranslatedResourcePrefix property.

If the found non- resource is not a String, the found value will be simply copied.

This option includes AppendFirstSpecificCulture and AppendLastSpecificCulture options.

This option is disabled by default.

AppendOnLoad128

If a resource set loaded, AppendNeutralCultures and AppendSpecificCultures rules are automatically applied for all resources.

This flag is enabled by default.

See Also

Reference