Ejemplo n.º 1
0
        public void Test_Locales()
        {
            LangRecord langRecord = new LangRecord(1049, "rus", "Russian", "filename.lng");

            Assert.IsNotNull(langRecord);
            Assert.AreEqual(1049, langRecord.Code);
            Assert.AreEqual("rus", langRecord.Sign);
            Assert.AreEqual("Russian", langRecord.Name);
            Assert.AreEqual("filename.lng", langRecord.FileName);
        }
        public override bool Accept()
        {
            try {
                LangRecord lngRec = fView.LanguagesList.GetSelectedData() as LangRecord;
                fSelectedLanguage = lngRec.Code;

                return(true);
            } catch (Exception ex) {
                Logger.WriteError("LanguageSelectDlgController.Accept()", ex);
                return(false);
            }
        }
        public LanguageSelectDlgController(ILanguageSelectDlg view) : base(view)
        {
            fView.LanguagesList.ClearItems();

            LangRecord defLang;

            if (GlobalOptions.Instance.Languages.Count > 0)
            {
                foreach (LangRecord lngRec in GlobalOptions.Instance.Languages)
                {
                    fView.LanguagesList.AddItem(lngRec, lngRec.Name);
                }
                defLang = GlobalOptions.Instance.GetLangByCode(LangMan.LS_DEF_CODE);
            }
            else
            {
                // unit-testing and some other cases
                defLang = new LangRecord(LangMan.LS_DEF_CODE, LangMan.LS_DEF_SIGN, LangMan.LS_DEF_NAME, "English.lng");
                fView.LanguagesList.AddItem(defLang, defLang.Name);
            }

            fView.LanguagesList.Activate();
            fView.LanguagesList.SelectItem(defLang);
        }