Opc.Ua.Server.ResourceManager.Add C# (CSharp) Method

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
        public void Add(XmlQualifiedName symbolicId, string locale, string text)
        {
            lock (m_lock)
            {
                if (symbolicId != null)
                {
                    string key = symbolicId.ToString();

                    Add(key, locale, text);

                    if (m_symbolicIdMapping == null)
                    {
                        m_symbolicIdMapping = new Dictionary<XmlQualifiedName, TranslationInfo>();
                    }

                    if (String.IsNullOrEmpty(locale) || locale == "en-US")
                    {
                        m_symbolicIdMapping[symbolicId] = new TranslationInfo(key, locale, text);
                    }
                }
            }
        }

Same methods

ResourceManager::Add ( string locale, string>.IDictionary translations ) : void
ResourceManager::Add ( string key, string locale, string text ) : void
ResourceManager::Add ( uint statusCode, string locale, string text ) : void

Usage Example

コード例 #1
0
        /// <summary>
        /// Creates the resource manager for the server.
        /// </summary>
        protected override ResourceManager CreateResourceManager(IServerInternal server, ApplicationConfiguration configuration)
        {
            ResourceManager resourceManager = new ResourceManager(server, configuration);
            
            // add some localized strings to the resource manager to demonstrate that localization occurs.
            resourceManager.Add("InvalidPassword", "de-DE", "Das Passwort ist nicht gültig für Konto '{0}'.");
            resourceManager.Add("InvalidPassword", "es-ES", "La contraseña no es válida para la cuenta de '{0}'.");

            resourceManager.Add("UnexpectedUserTokenError", "fr-FR", "Une erreur inattendue s'est produite lors de la validation utilisateur.");
            resourceManager.Add("UnexpectedUserTokenError", "de-DE", "Ein unerwarteter Fehler ist aufgetreten während des Anwenders.");
           
            return resourceManager;
        }
All Usage Examples Of Opc.Ua.Server.ResourceManager::Add