Пример #1
0
        private void lnkRefresh_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            cmbLanguage.Items.Clear();
            cmbLanguage.Items.Add("English");
            dsLanguages = new List <Library.Language>();
            dsLanguages.Add(new Library.Language());

            if (!Directory.Exists(GlobalSetting.StartUpDir + "Languages\\"))
            {
                Directory.CreateDirectory(GlobalSetting.StartUpDir + "Languages\\");
            }
            else
            {
                foreach (string f in Directory.GetFiles(GlobalSetting.StartUpDir + "Languages\\"))
                {
                    if (Path.GetExtension(f).ToLower() == ".iglang")
                    {
                        Library.Language l = new Library.Language(f);
                        dsLanguages.Add(l);

                        int    iLang   = cmbLanguage.Items.Add(l.LangName);
                        string curLang = GlobalSetting.LangPack.FileName;

                        //Nếu là ngôn ngữ đang dùng
                        if (f.CompareTo(curLang) == 0)
                        {
                            cmbLanguage.SelectedIndex = iLang;
                        }
                    }
                }
            }

            if (cmbLanguage.SelectedIndex == -1)
            {
                cmbLanguage.SelectedIndex = 0;
            }
        }
Пример #2
0
        private void lnkRefresh_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            cmbLanguage.Items.Clear();
            cmbLanguage.Items.Add("English");
            dsLanguages = new List<Library.Language>();
            dsLanguages.Add(new Library.Language());

            if (!Directory.Exists(GlobalSetting.StartUpDir + "Languages\\"))
            {
                Directory.CreateDirectory(GlobalSetting.StartUpDir + "Languages\\");
            }
            else
            {
                foreach (string f in Directory.GetFiles(GlobalSetting.StartUpDir + "Languages\\"))
                {
                    if (Path.GetExtension(f).ToLower() == ".iglang")
                    {
                        Library.Language l = new Library.Language(f);
                        dsLanguages.Add(l);

                        int iLang = cmbLanguage.Items.Add(l.LangName);
                        string curLang = GlobalSetting.LangPack.FileName;

                        //Nếu là ngôn ngữ đang dùng
                        if (f.CompareTo(curLang) == 0)
                        {
                            cmbLanguage.SelectedIndex = iLang;
                        }
                    }
                }
            }

            if (cmbLanguage.SelectedIndex == -1)
            {
                cmbLanguage.SelectedIndex = 0;
            }
        }