Пример #1
0
 /// <summary>
 /// 当程序启动时
 /// </summary>
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     AppManager.MainApp = this;
     AppManager.Awake();
 }
Пример #2
0
 /// <summary>
 /// 当程序退出时
 /// </summary>
 private void Application_Exit(object sender, ExitEventArgs e)
 {
     AppManager.Exit();
 }
Пример #3
0
        /// <summary>
        /// 读取项目中的所有东西
        /// (读取:项目文件、Bug文件、记录文件等)
        /// </summary>
        /// <param name="_projectFilePath">项目文件的路径(文件夹+文件名+文件后缀)</param>
        public void LoadProjectAll(string _projectFilePath)
        {
            /* [读取文件] */
            //读取项目(_isLoadOk代表是否读取成功?)
            bool _isLoadProjectOk = AppManager.Systems.ProjectSystem.LoadProject(_projectFilePath);//读取项目

            //读取Bug和记录
            AppManager.Systems.BugSystem.LoadBugs(AppManager.Systems.CollaborationSystem.ModeType);       //读取所有Bug
            AppManager.Systems.RecordSystem.LoadRecords(AppManager.Systems.CollaborationSystem.ModeType); //读取所有Record



            /* [测试代码] */
            AppManager.Test();



            /* [更新Ui] */
            AppManager.Systems.BugSystem.CalculatedBugsNumber();  //计算个数
            AppManager.Systems.SortSystem.Sort();                 //排序
            AppManager.Systems.SearchSystem.Filter();             //过滤
            AppManager.Systems.PageSytem.CalculatedPagesNumber(); //重新计算页码
            AppManager.Systems.PageSytem.Turn(1);                 //显示第一页



            /* 打开界面 (判断是否读取成功?) */
            if (_isLoadProjectOk == true)
            {
                //关闭Main界面,打开List界面
                AppManager.Uis.MainUi.OpenOrClose(false);
                AppManager.Uis.ListUi.OpenOrClose(true);

                /* 窗口位置居中 */
                AppManager.MainWindow.WindowPositionCenter();
            }
            else
            {
                //打开Tip界面
                AppManager.Uis.BaseTipUi.UiControl.TipTitle   = AppManager.Systems.LanguageSystem.ErrorTipTitle;
                AppManager.Uis.BaseTipUi.UiControl.TipContent = AppManager.Systems.LanguageSystem.OpenProjectErrorTipContent;
                AppManager.Uis.BaseTipUi.OpenOrClose(true);
            }



            /* 修改最近的项目 */
            if (_isLoadProjectOk == true)
            {
                AppManager.Systems.LatelySystem.Add(AppManager.Systems.ProjectSystem.ProjectData, _projectFilePath);
            }



            /* [进行备份] */
            if (_isLoadProjectOk == true)
            {
                //备份工程
                AppManager.Systems.BackupSystem.BackupProject();

                //备份Bug
                if (AppManager.Datas.ProjectData.BugDatas.Count > 0)
                {
                    AppManager.Systems.BackupSystem.BackupBug();
                }

                //备份Record
                if (AppManager.Datas.ProjectData.RecordDatas.Count > 0)
                {
                    AppManager.Systems.BackupSystem.BackupRecord();
                }
            }



            /* [删除的文件] */
            if (_isLoadProjectOk == true)
            {
                //删除所有要删除的文件
                AppManager.Systems.DeleteSystem.DeleteFile();
            }
        }