private void newWtfButton_Click(object sender, EventArgs e) { WtfDialog dialog = new WtfDialog(); if (dialog.ShowDialog(this) == DialogResult.OK) { WtfList.AddWtf(dialog.WtfName, dialog.WtfLocation); wtfListComboBox.SelectedIndex = wtfListComboBox.Items.Add(dialog.WtfName); checkListsEmpty(); addStatusMessage("WTF added."); } }
private void modifyWtfButton_Click(object sender, EventArgs e) { String wtfName = wtfListComboBox.Text; String wtfLocation = WtfList.GetWtfLocation(wtfName); WtfDialog dialog = new WtfDialog(wtfLocation, wtfName); if (dialog.ShowDialog(this) == DialogResult.OK) { if (wtfLocation != dialog.WtfLocation) { WtfList.ModifyWtfLocation(wtfName, dialog.WtfLocation); selectedWtfLocationLabel.Text = dialog.WtfLocation; } if (wtfName != dialog.WtfName) { WtfList.ModifyWtfName(wtfName, dialog.WtfName); var i = 0; foreach (String s in wtfListComboBox.Items) { if (s == wtfName) break; ++i; } wtfListComboBox.Items.Remove(wtfName); wtfListComboBox.SelectedIndex = wtfListComboBox.Items.Add(dialog.WtfName); } addStatusMessage("WTF modified."); } checkListsEmpty(); checkNewRealmAddress(); }