private void OnRenameConfig(object sender, EventArgs e) { if (ConfigList.SelectedCells.Count == 0) { return; } int index = ConfigList.SelectedCells[0].RowIndex; RenameConfigWin ren = new RenameConfigWin(); ren.ConfigName = Configs[index].Name; if (ren.ShowDialog() == DialogResult.OK) { if (string.IsNullOrEmpty(ren.ConfigName)) { MessageBox.Show("Config name can not be empty", "Error", MessageBoxButtons.OK); return; } Configs[index].Name = ren.ConfigName; DisplayConfigs(); } }
private void OnRenameConfig(object sender, EventArgs e) { if (ConfigList.SelectedCells.Count == 0) return; int index = ConfigList.SelectedCells[0].RowIndex; RenameConfigWin ren = new RenameConfigWin(); ren.ConfigName = Configs[index].Name; if (ren.ShowDialog() == DialogResult.OK) { if (string.IsNullOrEmpty(ren.ConfigName)) { MessageBox.Show("Config name can not be empty", "Error", MessageBoxButtons.OK); return; } Configs[index].Name = ren.ConfigName; DisplayConfigs(); } }