예제 #1
0
        private void Init()
        {
            if (_file.Exists)
            {
                _easyProperties.Clear();
                _easyProperties.Load(_file);

                string code        = _easyProperties[LANGUAGE_PROPERTIES_NODE_NAME].GetValue <string>("Code", "en-US");
                string displayName = _easyProperties[LANGUAGE_PROPERTIES_NODE_NAME].GetValue <string>("DisplayName", "English");
                string englishName = _easyProperties[LANGUAGE_PROPERTIES_NODE_NAME].GetValue <string>("EnglishName", "English");
                this.SetValue(code, displayName, englishName);
            }
            else
            {
                string      code = Path.GetFileNameWithoutExtension(_file.FullName);
                CultureInfo ci   = CultureInfo.GetCultureInfo(code);

                _easyProperties[LANGUAGE_PROPERTIES_NODE_NAME].SetValue <string>("Code", code);
                _easyProperties[LANGUAGE_PROPERTIES_NODE_NAME].SetValue <string>("DisplayName", ci.DisplayName);
                _easyProperties[LANGUAGE_PROPERTIES_NODE_NAME].SetValue <string>("EnglishName", ci.EnglishName);
                this.Save();
                this.File.LastWriteTime = new DateTime(1970, 1, 1);
                this.File.Refresh();
                this.SetValue(code, ci.DisplayName, ci.EnglishName);
            }
        }
예제 #2
0
 public void Reload()
 {
     _props.Clear();
     _props.Load(_file);
 }