private void AddToolStripMenuItem_Click(object sender, EventArgs e) { var AddNewVSSDialog = new Dialogs.AddEditVSSGroup(); var parentNode = (VSS_Entry_Group)VSS_Tree.SelectedNode; var res = AddNewVSSDialog.ShowDialog(); if (res == DialogResult.OK) { parentNode.AddChild(new VSS_Entry_Group(AddNewVSSDialog.NameDesc, AddNewVSSDialog.ReturnKey)); } }
private void EditNode() { var selectedNode = VSS_Tree.SelectedNode; if (selectedNode != VSS_RootEntry) { if (selectedNode.GetType() == typeof(VSS_Entry_Group)) { var nodeCast = (VSS_Entry_Group)selectedNode; var EditVSSDialog = new Dialogs.AddEditVSSGroup(true) { ReturnKey = nodeCast.Hotkey, NameDesc = nodeCast.Description }; var res = EditVSSDialog.ShowDialog(); if (res == DialogResult.OK) { nodeCast.Hotkey = EditVSSDialog.ReturnKey; nodeCast.Description = EditVSSDialog.NameDesc; nodeCast.UpdateNodeDisplay(); } } else { var nodeCast = (VSS_Entry_Sound)selectedNode; var EditVSSDialog = new Dialogs.AddEditVSSSound(true) { Hotkey = nodeCast.Hotkey, NameDesc = nodeCast.Description, FilePath = nodeCast.Filepath }; var res = EditVSSDialog.ShowDialog(); if (res == DialogResult.OK) { nodeCast.Hotkey = EditVSSDialog.Hotkey; nodeCast.Description = EditVSSDialog.NameDesc; nodeCast.Filepath = EditVSSDialog.FilePath; nodeCast.UpdateNodeDisplay(); } } } }