Smartsite Resources Classes
The common library Smartsite.Tools exposes several custom resource classes which are derived from and serve as a replacement for the framework resource classes. The common namespace for these custom resource classes is
Smartsite.Tools.Internationalization.Resources
The following custom classes are available:
-
SmartsiteResourceSet
Derived fromSystem.Resources.ResourceSet
A
ResourceSet
stores all the resources localized for one particular culture, ignoring all other cultures, including any fallback rules. ASmartsiteResourceSet
internally encapsulates two separate systemResourceSets
. OneResourceSet
represents the compiled resources embedded into the application at compile time. A secondResourceSet
represents custom resources that override and extend the embedded resources.SmartsiteResourceSet
expects a custom resource xml file to be located in the same folder as the (satellite) assembly containing the compiled resources. The custom resource file should be named according to the following standard:[AssemblyName].[ResourceName].[CultureName].xml
When retrieving the resource value for a certain resource identifier, a
SmartsiteResourceSet
first tries to return an associated resource value from the custom resource set. If a custom resource file does not exist, or if the file does not contain a custom resource value for the given resource identifier, thenSmartsiteResourceSet
falls back to the embedded application resource file.
-
SmartsiteResourceEnumerator
ImplementsIDictionaryEnumerator
andIEnumerator
Custom enumerator, enumerates all the available custom resources, and also any embedded resources that have not been overriden by an associated custom resource.
-
SmartsiteResourceManager
Derived from System.Resources.ResourceManagerSmartsiteResourceManager
manages the resource sets for all of the available cultures. Creates aSmartsiteResourceSet
instance for an embedded resource with an associated custom resource file, or a standardResourceSet
instance if no custom resource file exists. Returns customized resource values when available, and embedded resources otherwise.
-
SmartsiteComponentResourceManager
Derived fromSystem.Resources.ComponentResourceManager
ComponentResourceManager
is a specialized resource manager for use with Windows Forms that associates localizable control properties with values in the associated form resource file.SmartsiteComponentResourceManager
is a derived class that createsSmartsiteResourceSet
instances, like the regularSmartsiteResourceManager
.
-
ChangeFormCulture
Utility class exposing static helper methods to change the culture of a Windows Form at runtime, by reinitializing all the localizable form control properties from the resource file for the desired culture.