Form preset = new frmAddPreset(this, presetHandler);\r
if (preset.ShowDialog() == DialogResult.OK)\r
{\r
- TreeNode presetTreeview = new TreeNode(presetHandler.LastPresetAdded.Name) { ForeColor = Color.Black };\r
+ TreeNode presetTreeview = new TreeNode(presetHandler.LastPresetAdded.Name) { ForeColor = Color.Black, Tag = presetHandler.LastPresetAdded };\r
treeView_presets.Nodes.Add(presetTreeview);\r
presetHandler.LastPresetAdded = null;\r
}\r
{\r
foreach (TreeNode treenode in treeView_presets.Nodes)\r
{\r
+ if (treenode.Tag != null && ((Preset)treenode.Tag).Name == presetName)\r
+ {\r
+ treeView_presets.SelectedNode = treenode;\r
+ return;\r
+ }\r
+\r
foreach (TreeNode node in treenode.Nodes)\r
{\r
if (node.Text.Equals(presetName))\r
+ {\r
treeView_presets.SelectedNode = node;\r
+ return;\r
+ }\r
}\r
}\r
}\r