Пример #1
0
        /// <summary>
        /// 载入事件处理
        /// </summary>
        protected override void OnLoad()
        {
            using (LoadingModeScope.CreateScope())
            {
                SolutionModel model = new SolutionModel
                {
                    Solution = TargetConfig
                };

                model.RepairByLoaded();
                model.ResetStatus();
                model.OnSolutionLoad();

                TargetConfig.Projects.CollectionChanged    += ConfigCollectionChanged;
                TargetConfig.Enums.CollectionChanged       += ConfigCollectionChanged;
                TargetConfig.ApiItems.CollectionChanged    += ConfigCollectionChanged;
                TargetConfig.NotifyItems.CollectionChanged += ConfigCollectionChanged;
                TargetConfig.Entities.CollectionChanged    += EntitiesCollectionChanged;

                foreach (var cfg in TargetConfig.Enums)
                {
                    GlobalTrigger.OnLoad(cfg);
                }
                foreach (var cfg in TargetConfig.ApiItems)
                {
                    GlobalTrigger.OnLoad(cfg);
                }
                foreach (var cfg in TargetConfig.NotifyItems)
                {
                    GlobalTrigger.OnLoad(cfg);
                }
            }
        }
Пример #2
0
        /// <summary>
        /// 保存解决方案
        /// </summary>
        public void SaveSolution()
        {
            ConfigWriter.Save(Context.Solution, Context.FileName);
            SolutionModel model = new SolutionModel
            {
                Solution = Context.Solution
            };

            model.ResetStatus();
            Context.StateMessage = "保存成功";
        }
Пример #3
0
        /// <summary>
        /// 载入事件处理
        /// </summary>
        protected override void OnLoad()
        {
            using (WorkModelScope.CreateScope(WorkModel.Repair))
            {
                SolutionModel model = new SolutionModel
                {
                    Solution = TargetConfig
                };

                model.RepairByLoaded();
                model.ResetStatus();
                model.OnSolutionLoad();

                TargetConfig.ProjectList.CollectionChanged += ConfigCollectionChanged;
            }
        }