private void button2_Click(object sender, EventArgs e) { new SiteManager().ShowDialog(); String selname = ""; if (project_combo.SelectedIndex != -1) { if (!project_combo.Items[project_combo.SelectedIndex].Equals("")) { selname = project_combo.Items[project_combo.SelectedIndex].ToString(); } } SiteManagerClass.LoadFromSettings(); project_combo.Items.Clear(); foreach (DictionaryEntry dd in SiteManagerClass.table) { project_combo.Items.Add(dd.Key); } project_combo.Sorted = true; if (!selname.Equals("")) { int pos = 0; foreach (String s in project_combo.Items) { if (s.Equals(selname)) { project_combo.SelectedIndex = pos; break; } pos++; } } }
private void Auth_Load(object sender, EventArgs e) { version_label.Text = Version.GetName() + " " + Version.GetVersion(); version_label.Left = this.Width / 2 - version_label.Width / 2 - 15; save_pass.Checked = Options.GetOptionInt("save_pass") == 1 ? true : false; SetIfSaved(); l_list = i18n.GetLanguages(); langbox.Items.Clear(); string qq = Options.GetOption("language"); int i = 0; foreach (Language l in l_list) { langbox.Items.Add(l.med_name); if (l.short_name == qq) { i = langbox.Items.Count - 1; } } i18n.LoadLanguage(Options.GetOption("language")); UpdateLanguage(); langbox.SelectedIndex = i; SiteManagerClass.LoadFromSettings(); foreach (DictionaryEntry dd in SiteManagerClass.table) { project_combo.Items.Add(dd.Key); } project_combo.Sorted = true; int pos = 0; string last = Options.GetOption("wiki"); foreach (String s in project_combo.Items) { if (s.Equals(last)) { project_combo.SelectedIndex = pos; break; } pos++; } langbox.SelectedItem = i; }
private void SiteManager_Load(object sender, EventArgs e) { SiteManagerClass.LoadFromSettings(); SiteManagerClass.LoadToGrid(dataGridView1); }