private void loadTreeView() //加载树目录 { KBM = FileManagement.loadKnowledgeBaseManagement(); List <KnowledgeBase> kbs = KBM.getKBS(); foreach (KnowledgeBase kb in kbs) { TreeNode treeNode = addRootNode(kb.getName()); List <Note> notes = kb.GetNotes(); foreach (Note note in notes) { addSonNode(treeNode, note.getName()); } } }
private void list_treeView_MouseDoubleClick(object sender, MouseEventArgs e)//知识树的双击事件 { TreeNode node = list_treeView.SelectedNode; if (null != node) { if (1 == node.Level) { ClosePreForm();//嵌入窗体前判断当前容器中是否有窗口没关掉 NodeForm nodeForm = new NodeForm(); nodeForm.edit_richTextBox.Dock = DockStyle.Fill; //将富文本框设置为自动适应 int index = node.Index; TreeNode prant = node.Parent; int ip = prant.Index; //MessageBox.Show("" + index+"-"+ip); Note note = KBM.getKB(ip).getNote(index); bindingNoteForm(nodeForm, note); OpenForm(nodeForm, note.getName()); showNote(nodeForm, note); //MessageBox.Show("" + note.getRecordLocation()); } } }