public static void RefreshLCnMID() { MMain.locales = Locales.AllList(); lcnmid.Clear(); foreach (var lc in locales) { lcnmid.Add(lc.Lang + "(" + lc.uId + ")"); } }
void RefreshLocales() // Refreshes locales in comboboxes { Locales.IfLessThan2(); MMain.locales = Locales.AllList(); cbLCLocalesList.Items.Clear(); cbRCLocalesList.Items.Clear(); MMain.lcnmid.Clear(); foreach (Locales.Locale lc in MMain.locales) { cbLCLocalesList.Items.Add(lc.Lang + "(" + lc.uId + ")"); cbRCLocalesList.Items.Add(lc.Lang + "(" + lc.uId + ")"); MMain.lcnmid.Add(lc.Lang + "(" + lc.uId + ")"); } }
void RefreshLocales() //Re-adds existed locales to select boxes { Locales.IfLessThan2(); MMain.locales = Locales.AllList(); cbLangOne.Items.Clear(); cbLangTwo.Items.Clear(); MMain.lcnmid.Clear(); foreach (Locales.Locale lc in MMain.locales) { cbLangOne.Items.Add(lc.Lang + "(" + lc.uId + ")"); cbLangTwo.Items.Add(lc.Lang + "(" + lc.uId + ")"); MMain.lcnmid.Add(lc.Lang + "(" + lc.uId + ")"); } try { cbLangOne.SelectedIndex = MMain.lcnmid.IndexOf(MMain.MyConfs.Read("Locales", "locale1Lang") + "(" + MMain.MyConfs.Read("Locales", "locale1uId") + ")"); cbLangTwo.SelectedIndex = MMain.lcnmid.IndexOf(MMain.MyConfs.Read("Locales", "locale2Lang") + "(" + MMain.MyConfs.Read("Locales", "locale2uId") + ")"); } catch { MessageBox.Show(MMain.Msgs[9], MMain.Msgs[5], MessageBoxButtons.OK, MessageBoxIcon.Exclamation); RefreshLocales(); cbLangOne.SelectedIndex = 0; cbLangTwo.SelectedIndex = 1; } }