Пример #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>
 /// <param name="sluFile"></param>
 public void Load(string sluFile)
 {
     Context.StateMessage = "正在载入...";
     LoadFile(sluFile);
     using (LoadingModeScope.CreateScope())
         Model.Tree.CreateTree();
     Context.NowJob       = DesignContext.JobPropertyGrid;
     Context.StateMessage = "载入成功";
 }
Пример #3
0
 /// <summary>
 /// 保存
 /// </summary>
 private void SaveSolution()
 {
     using (LoadingModeScope.CreateScope())
     {
         SaveProjects();
         SaveTypedefs();
         SaveEnums();
         SaveApies();
         SaveNotifies();
         Serializer(Solution.FileName, Solution);
     }
     //VersionControlItem.Current.TfsCheckIn();
 }
Пример #4
0
 /// <summary>
 /// 载入事件处理
 /// </summary>
 protected override void OnLoad()
 {
     using (LoadingModeScope.CreateScope())
     {
         foreach (var cfg in TargetConfig.Classifies)
         {
             GlobalTrigger.OnLoad(cfg);
         }
         TargetConfig.IsReference = TargetConfig.Entities.All(p => p.IsReference);
         foreach (var entity in TargetConfig.Entities)
         {
             entity.Project = TargetConfig.Name;
             entity.Parent  = TargetConfig;
             foreach (var field in entity.Properties)
             {
                 field.Parent = entity;
             }
         }
     }
 }
Пример #5
0
        private void LoadSolution(string directory, string file, bool isGlobal)
        {
            var sluFile = Path.Combine(directory, file);

            using (LoadingModeScope.CreateScope())
            {
                try
                {
                    _solution = DeSerializer <SolutionConfig>(sluFile) ?? new SolutionConfig
                    {
                        Name        = "GlobalConfig",
                        Caption     = "全局配置",
                        Description = "全局配置"
                    };
                }
                catch (Exception exception)
                {
                    Debug.WriteLine(exception);
                    _solution = new SolutionConfig();
                }
                _solution.IsGlobal = isGlobal;
                _solution.FileName = sluFile;
                try
                {
                    LoadProjects(directory);
                    LoadTypedefs(directory);
                    LoadEnums(directory);
                    LoadApi(directory);
                    LoadNotify(directory);
                }
                catch (Exception ex)
                {
                    Trace.WriteLine(ex);
                }
                GlobalTrigger.OnLoad(_solution);
            }
        }
 static EntityInterfaceCommand()
 {
     using (LoadingModeScope.CreateScope())
     {
         _dataState = new PropertyConfig
         {
             IsPredefined     = true,
             Caption          = "数据状态",
             Description      = "数据状态",
             Index            = -1,//100,
             Name             = "DataState",
             CustomType       = "DataStateType",
             CsType           = "int",
             ColumnName       = "data_state",
             Initialization   = "0",
             DbType           = "INT",
             DbNullable       = false,
             IsSystemField    = true,
             IsInterfaceField = true,
             Group            = "系统_数据状态"
         };
         _isFreeze = new PropertyConfig
         {
             IsPredefined     = true,
             Caption          = "数据是否已冻结",
             Description      = "数据是否已冻结",
             Index            = -1,//101,
             Name             = "IsFreeze",
             CsType           = "bool",
             ColumnName       = "is_freeze",
             Initialization   = "0",
             DbType           = "BOOL",
             DbNullable       = false,
             IsSystemField    = true,
             IsInterfaceField = true,
             Group            = "系统_数据状态"
         };
         _authorId = new PropertyConfig
         {
             IsPredefined     = true,
             Caption          = "制作人",
             Description      = "制作人",
             Index            = -1,//102,
             Name             = "AuthorID",
             CsType           = "int",
             ColumnName       = "author_id",
             DbType           = "int",
             Initialization   = "0",
             DbNullable       = false,
             IsSystemField    = true,
             IsInterfaceField = true,
             Group            = "系统_历史"
         };
         _addDate = new PropertyConfig
         {
             IsPredefined = true,
             Caption      = "制作时间",
             Description  = "制作时间",
             Index        = -1,//103,
             Name         = "AddDate",
             CsType       = "DateTime",
             //IsCompute = true,
             ColumnName       = "add_date",
             DbType           = "DateTime",
             DbNullable       = true,
             IsSystemField    = true,
             IsInterfaceField = true,
             Group            = "系统_历史"
         };
         _lastReviserId = new PropertyConfig
         {
             IsPredefined     = true,
             Caption          = "最后修改者",
             Description      = "最后修改者",
             Index            = -1,//104,
             Name             = "LastReviserID",
             CsType           = "int",
             ColumnName       = "last_reviser_id",
             DbType           = "int",
             Initialization   = "0",
             DbNullable       = false,
             IsSystemField    = true,
             IsInterfaceField = true,
             Group            = "系统_历史"
         };
         _lastModifyDate = new PropertyConfig
         {
             IsPredefined     = true,
             Caption          = "最后修改日期",
             Description      = "最后修改日期",
             Index            = -1,//105,
             Name             = "LastModifyDate",
             CsType           = "DateTime",
             ColumnName       = "last_modify_date",
             DbType           = "DateTime",
             DbNullable       = true,
             IsSystemField    = true,
             IsInterfaceField = true,
             Group            = "系统_历史"
         };
         _auditState = new PropertyConfig
         {
             IsPredefined     = true,
             Caption          = "审核状态",
             Description      = "审核状态",
             Index            = -1,//106,
             Name             = "AuditState",
             CustomType       = "AuditStateType",
             CsType           = "int",
             ColumnName       = "audit_state",
             DbType           = "int",
             Initialization   = "0",
             DbNullable       = false,
             IsSystemField    = true,
             IsInterfaceField = true,
             Group            = "系统_审核"
         };
         _auditorId = new PropertyConfig
         {
             IsPredefined     = true,
             Caption          = "审核人",
             Description      = "审核人",
             Index            = -1,//107,
             Name             = "AuditorId",
             CsType           = "int",
             ColumnName       = "auditor_id",
             DbType           = "int",
             Initialization   = "0",
             DbNullable       = false,
             IsSystemField    = true,
             IsInterfaceField = true,
             Group            = "系统_审核"
         };
         _auditDate = new PropertyConfig
         {
             IsPredefined     = true,
             Caption          = "审核时间",
             Description      = "审核时间",
             Index            = -1,//108,
             Name             = "AuditDate",
             CsType           = "DateTime",
             ColumnName       = "audit_date",
             DbType           = "DateTime",
             DbNullable       = true,
             IsSystemField    = true,
             IsInterfaceField = true,
             Group            = "系统_审核"
         };
         _memo = new PropertyConfig
         {
             IsPredefined     = true,
             Caption          = "备注",
             Description      = "备注",
             Index            = -1,//27,
             Name             = "Memo",
             CsType           = "string",
             CanEmpty         = true,
             ColumnName       = "memo",
             DbType           = "TEXT",
             DbNullable       = true,
             IsSystemField    = false,
             IsInterfaceField = false,
             Group            = "备注",
             IsMemo           = true
         };
         _parent = new PropertyConfig
         {
             IsPredefined     = true,
             Caption          = "上级标识",
             Description      = "上级标识,顶级为0",
             Index            = -1,//27,
             Name             = "ParentId",
             CsType           = "int",
             ColumnName       = "parent_id",
             DbType           = "int",
             DbNullable       = false,
             IsSystemField    = true,
             IsInterfaceField = true,
             Group            = "树形"
         };
         _slaveOId = new PropertyConfig
         {
             IsPredefined     = true,
             Caption          = "下级机构ID",
             Description      = "用于下级机构ID查找到对应的上级",
             Index            = -1,//28,
             Name             = "SlaveOrgId",
             CsType           = "int",
             ColumnName       = "slave_org_id",
             DbType           = "int",
             DbNullable       = false,
             IsSystemField    = false,
             IsInterfaceField = false,
             Group            = "行级权限"
         };
     }
 }