private void addGroupToolStripMenuItem_Click(object sender, EventArgs e) { using (var dialog = new NameEntryDialog("Add preset group")) { dialog.GroupName = "New group"; if (dialog.ShowDialog(this) == DialogResult.OK) { PresetGroup group = new PresetGroup() { Name = dialog.GroupName }; Settings.PresetGroups.Add(group); SavePresets(); } } }
private void renameToolStripMenuItem_Click(object sender, EventArgs e) { var preset = GetSelectedNodeTag <Preset>(); var presetNode = presetTreeView.SelectedNode; if (preset != null) { using (var dialog = new NameEntryDialog("Rename preset")) { dialog.GroupName = preset.Name; if (dialog.ShowDialog(this) == DialogResult.OK) { preset.Name = presetNode.Text = dialog.GroupName; SavePresets(); } } } }
private void addPresetToolStripMenuItem_Click(object sender, EventArgs e) { var group = GetSelectedNodeTag <PresetGroup>(); var groupNode = presetTreeView.SelectedNode; if (group != null) { var preset = new Preset(); _capturePresetFunction(preset); using (var dialog = new NameEntryDialog("Add preset")) { if (dialog.ShowDialog(this) == DialogResult.OK) { preset.Name = dialog.GroupName; group.Presets.Add(preset); SavePresets(); } } } }