UA Bundle SDK .NET  2.2.1.258
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Groups Pages
UnifiedAutomation.UaServer.ResourceManager Class Reference

An object that manages access to localized resources. More...

Inherits IDisposable, and UnifiedAutomation.UaBase.ITranslationManager.

Public Member Functions

 ResourceManager (ApplicationInstance application)
 Initializes the resource manager with the server instance that owns it. More...
 
void Dispose ()
 May be called by the application to clean up resources. More...
 
virtual LocalizedText Translate (IList< string > preferredLocales, string key, string text, params object[] args)
 Translates the text and then formats it with the arguments provided. More...
 
LocalizedText Translate (IList< string > preferredLocales, LocalizedText defaultText)
 Translates the LocalizedText using the information in the TranslationInfo property. More...
 
StatusCode Translate (IList< string > preferredLocales, StatusCode result)
 Translates the specified preferred locales. More...
 
virtual string[] GetAvailableLocales ()
 Returns the locales supported by the resource manager. More...
 
void Add (string key, string locale, string text)
 Adds a translation to the resource manager. More...
 
void Add (string locale, IDictionary< string, string > translations)
 Adds the translations to the resource manager. More...
 
void Add (uint statusCode, string locale, string text)
 Adds the translations to the resource manager. More...
 
void Add (XmlQualifiedName symbolicId, string locale, string text)
 Adds the translations to the resource manager. More...
 
void LoadDefaultText ()
 Uses reflection to load default text for standard StatusCodes. More...
 

Protected Member Functions

virtual void Dispose (bool disposing)
 Cleans up all resources held by the object. More...
 

Detailed Description

An object that manages access to localized resources.

Constructor & Destructor Documentation

UnifiedAutomation.UaServer.ResourceManager.ResourceManager ( ApplicationInstance  application)
inline

Initializes the resource manager with the server instance that owns it.

Member Function Documentation

void UnifiedAutomation.UaServer.ResourceManager.Add ( string  key,
string  locale,
string  text 
)
inline

Adds a translation to the resource manager.

Parameters
keyThe key.
localeThe locale.
textThe text.
void UnifiedAutomation.UaServer.ResourceManager.Add ( string  locale,
IDictionary< string, string >  translations 
)
inline

Adds the translations to the resource manager.

Parameters
localeThe locale.
translationsThe translations.
void UnifiedAutomation.UaServer.ResourceManager.Add ( uint  statusCode,
string  locale,
string  text 
)
inline

Adds the translations to the resource manager.

Parameters
statusCodeThe status code.
localeThe locale.
textThe text.
void UnifiedAutomation.UaServer.ResourceManager.Add ( XmlQualifiedName  symbolicId,
string  locale,
string  text 
)
inline

Adds the translations to the resource manager.

Parameters
symbolicIdThe symbolic id.
localeThe locale.
textThe text.
void UnifiedAutomation.UaServer.ResourceManager.Dispose ( )
inline

May be called by the application to clean up resources.

virtual void UnifiedAutomation.UaServer.ResourceManager.Dispose ( bool  disposing)
inlineprotectedvirtual

Cleans up all resources held by the object.

virtual string [] UnifiedAutomation.UaServer.ResourceManager.GetAvailableLocales ( )
inlinevirtual

Returns the locales supported by the resource manager.

Returns
The available locales
void UnifiedAutomation.UaServer.ResourceManager.LoadDefaultText ( )
inline

Uses reflection to load default text for standard StatusCodes.

virtual LocalizedText UnifiedAutomation.UaServer.ResourceManager.Translate ( IList< string >  preferredLocales,
string  key,
string  text,
params object[]  args 
)
inlinevirtual

Translates the text and then formats it with the arguments provided.

Parameters
preferredLocalesThe list of preferred locales
keyThe key used to look up the translation
textThe text to translate
argsThe format argumente
Returns
The translated text

Implements UnifiedAutomation.UaBase.ITranslationManager.

LocalizedText UnifiedAutomation.UaServer.ResourceManager.Translate ( IList< string >  preferredLocales,
LocalizedText  defaultText 
)
inline

Translates the LocalizedText using the information in the TranslationInfo property.

Parameters
preferredLocalesThe preferred locales.
defaultTextThe default text.
Returns

The translated text

Implements UnifiedAutomation.UaBase.ITranslationManager.

StatusCode UnifiedAutomation.UaServer.ResourceManager.Translate ( IList< string >  preferredLocales,
StatusCode  result 
)
inline

Translates the specified preferred locales.

Parameters
preferredLocalesThe preferred locales.
resultThe result.
Returns
The translated status code

Implements UnifiedAutomation.UaBase.ITranslationManager.


The documentation for this class was generated from the following file: