private void newTree() { treeView.Nodes.Clear(); textView.Clear(); _tree = new TOKTree(""); TreeNode root = makeTreeNode(_tree.Root); treeView.Nodes.Add(root); treeView.SelectedNode = root; }
private void openToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog openDlg = new OpenFileDialog { CheckPathExists = true, Filter = "Tree Of Knowledge files (*.tok)|*.tok", DefaultExt = "tok", FilterIndex = 1 }; if (openDlg.ShowDialog() == DialogResult.OK) { treeView.Nodes.Clear(); textView.Clear(); _tree = new TOKTree(""); _tree.Open(openDlg.FileName); TreeNode root = makeTreeNode(_tree.Root); treeView.Nodes.Add(root); treeView.SelectedNode = root; treeView.ExpandAll(); } }