private void OpenToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (this.openFileDialog1.ShowDialog() == DialogResult.OK)
     {
         Page page = new Page(this.openFileDialog1.FileName);
         this.tabControl2.TabPages.Add(page.tabPage);
         this.tabControl2.SelectedTab = page.tabPage;
         this.openFiles.Add(page);
         this.currentFile = page;
     }
 }
        private void MainForm_Load(object sender, EventArgs e)
        {
            //初始化数据
            this.openFiles = new List<Page>();
            this.basePreconditions = PreconditionHandler.getInstance().getBasePreconditions();
            if (this.basePreconditions == null)
            {
                this.basePreconditions = new List<Precondition>();
            }
            this.baseNodes = NodeHandler.getInstance().getBaseNodes();
            if (this.baseNodes == null)
            {
                this.baseNodes = new List<Node>();
            }
            this.baseTrees = TemplateHandler.getInstance().getBaseTrees();
            if (this.baseTrees == null)
            {
                this.baseTrees = new List<Tree>();
            }

            //数据源绑定
            this.NodeListBoxDataBinding();
            this.PreconditionListBoxDataBinding();
            this.TemplateListBoxDataBinding();

            //显示
            this.toolStripStatusLabel1.Text = "版本: 1.0.1.0";

            //加载最后修改文件
            string path = PageHandler.getInstance().getLastPage();
            if (path != null && path.Length > 0 && File.FileIsExist(path))
            {
                Page page = new Page(path);
                this.tabControl2.TabPages.Add(page.tabPage);
                this.tabControl2.SelectedTab = page.tabPage;
                this.openFiles.Add(page);
                this.currentFile = page;

            }
        }
 private void NewToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Page page = new Page();
     this.tabControl2.TabPages.Add(page.tabPage);
     this.tabControl2.SelectedTab = page.tabPage;
     this.openFiles.Add(page);
     this.currentFile = page;
 }
 /// <summary>
 /// 编辑模板节点菜单点击事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void editTemplateNodeToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Tree editT = this.baseTrees[this.templateListBox.SelectedIndex];
     Page page = new Page(editT);
     page.isTemplate = true;
     this.tabControl2.TabPages.Add(page.tabPage);
     this.tabControl2.SelectedTab = page.tabPage;
     this.openFiles.Add(page);
     this.currentFile = page;
 }