private void toolStripMenuItemInsertTerm_Click(object sender, EventArgs e) { DocTerm docNorm = new DocTerm(); TreeNode tnParent = this.treeView.Nodes[2]; TreeNode tnSelect = this.treeView.SelectedNode; if (tnSelect.Tag is DocTerm) { tnParent = tnSelect; // nested term DocTerm parent = (DocTerm)tnSelect.Tag; parent.Terms.Add(docNorm); this.treeView.SelectedNode = this.LoadNode(tnParent, docNorm, docNorm.ToString(), true); } else { this.m_project.Terms.Add(docNorm); this.treeView.SelectedNode = this.LoadNode(tnParent, docNorm, docNorm.ToString(), true, this.m_project.Terms.Count - 1); } toolStripMenuItemEditRename_Click(this, e); }
private void LoadTreeTerm(TreeNode tnParent, DocTerm docTemplate) { TreeNode tnTemplate = LoadNode(tnParent, docTemplate, docTemplate.Name, true); foreach (DocTerm docSub in docTemplate.Terms) { LoadTreeTerm(tnTemplate, docSub); } }