Beispiel #1
0
 /// <summary>
 /// 新建项目
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void NewProject_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         NewProject nProject = new NewProject();
         ///设置项目类
         nProject.SetProjectClass(_myProject, _solution);
         nProject.ShowDialog();
         if (_myProject.RootPath != "")
         {
             ///设置项目根目录
             Solution.RootPath = _myProject.RootPath;
             ///创建主类和主函数信息
             PicTabPage mainpage = new PicTabPage((new Random()).Next(1, 2000000), this.ChileEventCallBack, "Program.cx");
             CodeBox    mainbox  = mainpage.CreateXCodeBox("Main", PicTabPage.CenterPoint, CodeBox.XAType.XMain);
             mainbox.AddAttribute(MyXAribute.XAribute.XAttributeType.XExc, MyXAribute.XAribute.XAttributeSpec.XNone,
                                  MyXAribute.XAribute.XPositonStyle.right, "出口", MyXAribute.XAribute.CanLinkType.One, "主函数出口", "");
             ///添加主信息
             _myProject.AddPicTabPage(mainpage);
             ///将代码图添加到tab页
             AddLayoutDocument(ContentPanel, mainpage);
             ///绑定各个面板数据
             BindingPanels(mainpage);
         }
         ///保存配置文件路径
         Solution.SolutionConfigPath = XCreateConfigurationInformation.SolutionConfigPath;
         ///添加到解决方案
         Solution.AddProjectClass(MyProject);
     }
     catch (Exception ex)
     {
         LoggerHelp.WriteLogger(ex.ToString());
     }
 }