C# Class Opc.Ua.Server.ResourceManager

An object that manages access to localized resources.
Inheritance: IDisposable, ITranslationManager
ファイルを表示 Open project: OPCFoundation/UA-.NET Class Usage Examples

Public Methods

Method Description
Add ( XmlQualifiedName symbolicId, string locale, string text ) : void

Adds the translations to the resource manager.

Add ( string locale, string>.IDictionary translations ) : void

Adds the translations to the resource manager.

Add ( string key, string locale, string text ) : void

Adds a translation to the resource manager.

Add ( uint statusCode, string locale, string text ) : void

Adds the translations to the resource manager.

Dispose ( ) : void

May be called by the application to clean up resources.

GetAvailableLocales ( ) : string[]

Returns the locales supported by the resource manager.

LoadDefaultText ( ) : void

Uses reflection to load default text for standard StatusCodes.

ResourceManager ( IServerInternal server, ApplicationConfiguration configuration ) : System

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

Translate ( IList preferredLocales, LocalizedText text ) : LocalizedText
Translate ( IList preferredLocales, string key, string text ) : LocalizedText
Translate ( IList preferredLocales, ServiceResult result ) : ServiceResult

Translates a service result.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Cleans up all resources held by the object.

Translate ( IList preferredLocales, LocalizedText defaultText, TranslationInfo info ) : LocalizedText

Translates the text provided.

Private Methods

Method Description
FindBestTranslation ( IList preferredLocales, string key, CultureInfo &culture ) : string

Finds the best translation for the requested locales.

GetAvailableLocales ( IEnumerable preferredLocales ) : string[]
GetTable ( string locale ) : TranslationTable

Finds the translation table for the locale. Creates a new table if it does not exist.

GetText ( IList preferredLocales, string textId, string defaultText ) : LocalizedText
GetTextForLocale ( string locale, string textId, string defaultText ) : string
TranslateStatusCode ( IList preferredLocales, StatusCode statusCode, object args ) : LocalizedText

Translates a status code.

TranslateSymbolicId ( IList preferredLocales, string symbolicId, string namespaceUri, object args ) : LocalizedText

Translates a symbolic id.

Method Details

Add() public method

Adds the translations to the resource manager.
public Add ( XmlQualifiedName symbolicId, string locale, string text ) : void
symbolicId System.Xml.XmlQualifiedName
locale string
text string
return void

Add() public method

Adds the translations to the resource manager.
public Add ( string locale, string>.IDictionary translations ) : void
locale string
translations string>.IDictionary
return void

Add() public method

Adds a translation to the resource manager.
public Add ( string key, string locale, string text ) : void
key string
locale string
text string
return void

Add() public method

Adds the translations to the resource manager.
public Add ( uint statusCode, string locale, string text ) : void
statusCode uint
locale string
text string
return void

Dispose() public method

May be called by the application to clean up resources.
public Dispose ( ) : void
return void

Dispose() protected method

Cleans up all resources held by the object.
protected Dispose ( bool disposing ) : void
disposing bool
return void

GetAvailableLocales() public method

Returns the locales supported by the resource manager.
public GetAvailableLocales ( ) : string[]
return string[]

LoadDefaultText() public method

Uses reflection to load default text for standard StatusCodes.
public LoadDefaultText ( ) : void
return void

ResourceManager() public method

Initializes the resource manager with the server instance that owns it.
public ResourceManager ( IServerInternal server, ApplicationConfiguration configuration ) : System
server IServerInternal
configuration ApplicationConfiguration
return System

Translate() public method

public Translate ( IList preferredLocales, LocalizedText text ) : LocalizedText
preferredLocales IList
text LocalizedText
return LocalizedText

Translate() protected method

Translates the text provided.
protected Translate ( IList preferredLocales, LocalizedText defaultText, TranslationInfo info ) : LocalizedText
preferredLocales IList
defaultText LocalizedText
info TranslationInfo
return LocalizedText

Translate() public method

public Translate ( IList preferredLocales, string key, string text ) : LocalizedText
preferredLocales IList
key string
text string
return LocalizedText

Translate() public method

Translates a service result.
public Translate ( IList preferredLocales, ServiceResult result ) : ServiceResult
preferredLocales IList
result ServiceResult
return ServiceResult