private void addValue() { TypeInputForm tif = new TypeInputForm(); if (tif.ShowDialog(this) == DialogResult.OK) { OptionBase theOption = OptionFactory.CreateOption(tif.Result); Category theCategory; TreeNode theNode; if (this.tree.SelectedNode.Tag is Category) { theNode = this.tree.SelectedNode; } else { theNode = this.tree.SelectedNode.Parent; } theCategory = (Category)theNode.Tag; theCategory.Options.Add(theOption); theNode.Nodes.Clear(); this.displayCat(theNode); this.tree.SelectedNode = theNode.Nodes[theNode.Nodes.Count - 1]; } }
void addValue() { TypeInputForm tif = new TypeInputForm(); if(tif.ShowDialog(this) == DialogResult.OK) { OptionBase theOption = OptionFactory.CreateOption(tif.Result); Category theCategory; TreeNode theNode; if(tree.SelectedNode.Tag is Category) theNode = tree.SelectedNode; else theNode = tree.SelectedNode.Parent; theCategory = (Category)theNode.Tag; theCategory.Options.Add(theOption); theNode.Nodes.Clear(); displayCat( theNode ); tree.SelectedNode = theNode.Nodes[theNode.Nodes.Count - 1]; } }