Exemplo n.º 1
0
        /// <summary>
        /// load language info from config file
        /// </summary>
        /// <param name="lcid"></param>
        private void LoadLanginfo(int lcid)
        {
            XPathNavigator node = _config.CreateNavigator().SelectSingleNode(String.Format("/configuration/languages/language[@id='{0}']", lcid.ToString()));

            if (node != null)
            {
                _lang          = new LangInfo();
                _lang.ID       = lcid;
                _lang.CodePage = Convert.ToInt32(node.GetAttribute("codepage", string.Empty));
                _lang.Name     = node.GetAttribute("name", string.Empty);
            }
            else
            {
                throw new ArgumentException(String.Format("language {0} is not found in config file.", lcid));
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// load language info from config file
 /// </summary>
 /// <param name="lcid"></param>
 private void LoadLanginfo(int lcid)
 {
     XPathNavigator node = _config.CreateNavigator().SelectSingleNode(String.Format("/configuration/languages/language[@id='{0}']", lcid.ToString()));
     if (node != null)
     {
         _lang = new LangInfo();
         _lang.ID = lcid;
         _lang.CodePage = Convert.ToInt32(node.GetAttribute("codepage", string.Empty));
         _lang.Name = node.GetAttribute("name", string.Empty);
     }
     else
     {
         throw new ArgumentException(String.Format("language {0} is not found in config file.", lcid));
     }
 }