AutoAppendOptions Enumeration

Represents the resource auto append options of a DynamicResourceManager instance. These options are ignored if Source is CompiledOnly.

Definition

Namespace: KGySoft.Resources
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0-preview.1
C#
[FlagsAttribute]
public enum AutoAppendOptions

Members

None0x00 Represents no auto appending.
AddUnknownToInvariantCulture0x01

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.

AppendFirstNeutralCulture0x02

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.

AppendLastNeutralCulture0x04

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.

AppendNeutralCultures0x0E

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.

AppendFirstSpecificCulture0x10

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.

AppendLastSpecificCulture0x20

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.

AppendSpecificCultures0x70

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.

AppendOnLoad0x80

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

This flag is enabled by default.

See Also