Ejemplo n.º 1
0
        private void newNote()
        {
            TreeNode node;

            if ((node = list_treeView.SelectedNode) != null)
            {
                Tip notepage = new Tip("请输入笔记页名称");
                notepage.ShowDialog();
                if (nodeName.Equals(""))
                {
                    return;
                }

                ClosePreForm();                                  //嵌入窗体前判断当前容器中是否有窗口没关掉
                NodeForm nodeForm = new NodeForm();
                nodeForm.edit_richTextBox.Dock = DockStyle.Fill; //设置富文本框的填充
                int           index = node.Index;
                KnowledgeBase kb    = KBM.getKB(index);
                Note          note;
                if ((note = FileManagement.newNote(kb, nodeName)) != null)
                {
                    addSonNode(node, nodeName);
                    OpenForm(nodeForm, nodeName);
                    bindingNoteForm(nodeForm, note);
                }
            }
        }
Ejemplo n.º 2
0
        private void exportKB()
        {
            TreeNode node;

            if ((node = list_treeView.SelectedNode) != null)
            {
                int index = node.Index;
                FileManagement.exportKB(KBM.getKB(index));
            }
        }
Ejemplo n.º 3
0
        private void importNote()
        {
            TreeNode node;

            if ((node = list_treeView.SelectedNode) != null)
            {
                int           index = node.Index;
                KnowledgeBase kb    = KBM.getKB(index);
                FileManagement.importNoteDialog(KBM, kb);
                updateTree();
            }
        }
Ejemplo n.º 4
0
        private void newKB()
        {
            Tip notepage = new Tip("请输入知识库名称");

            notepage.ShowDialog();
            if (!nodeName.Equals(""))
            {
                if (FileManagement.newKB(KBM, nodeName))
                {
                    updateTree();
                }
            }
        }
Ejemplo n.º 5
0
        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());
                }
            }
        }
Ejemplo n.º 6
0
        private void exportNote()
        {
            TreeNode node = list_treeView.SelectedNode;

            if (null != node)
            {
                if (node.Parent != null)
                {
                    int      index = node.Index;
                    TreeNode prant = node.Parent;
                    int      ip    = prant.Index;
                    Note     note  = KBM.getKB(ip).getNote(index);
                    FileManagement.exportNote(note);
                }
            }
        }
Ejemplo n.º 7
0
 private void importKB()
 {
     FileManagement.importKBDialog(KBM);
     updateTree();
 }