/// <summary> /// Prompts the user for a group name and if it gets a name it adds it to /// database and then refreshes the groupListBox. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void newGroupButton_Click(object sender, EventArgs e) { GroupEditor editor = new GroupEditor("", "New Group", "Add"); editor.ShowDialog(); if (editor.NewName != "") { db.addGroup(editor.NewName); refreshGroups(); enableForwardBackButtons(); } }
/// <summary> /// Renames currently selected group using the GroupEditor. /// Refreshes groups. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void renameMenuItem_Click(object sender, EventArgs e) { if (groupListBox.SelectedIndex >= 0) { GroupEditor messageBox = new GroupEditor(groupListBox.SelectedItem.ToString(), "Rename Group", "Rename"); messageBox.ShowDialog(); string tempName = messageBox.NewName; if (tempName != "") { db.renameGroup((AVM.Types.Group)groupListBox.SelectedItem, tempName); refreshGroups(); } } }