Esempio n. 1
0
 /// <summary>
 /// 构造
 /// </summary>
 public DataModelDesignModel()
 {
     Current = this;
     LoadUserScreen();
     if (User == null)
     {
         User = new UserInfo();
     }
     User.ContextJson = JsonConvert.SerializeObject(GlobalContext.Current, Formatting.Indented);
     Tree             = new TreeModel
     {
         Model = this
     };
     Tree.PropertyChanged += Tree_PropertyChanged;
 }
Esempio n. 2
0
        /// <summary>
        /// 载入解决方案
        /// </summary>
        public void Load()
        {
            var sfd = new OpenFileDialog
            {
                Filter   = fileType,
                FileName = Context.FileName
            };

            if (sfd.ShowDialog() != true)
            {
                return;
            }
            Load(sfd.FileName);
            DataModelDesignModel.Screen.LastFile = sfd.FileName;
            DataModelDesignModel.SaveUserScreen();
        }
 /// <summary>
 /// 构造
 /// </summary>
 public DataModelDesignModel()
 {
     Current = this;
     Context = new DesignContext
     {
         Model = this
     };
     GlobalConfig.SetGlobal(new DesignGlobal
     {
         Model   = this,
         Context = Context
     });
     LoadUserScreen();
     ExtendConfig = new ExtendConfigModel
     {
         Model   = this,
         Context = Context
     };
     Tree = new TreeModel
     {
         Model   = this,
         Context = Context
     };
     ConfigIo = new ConfigIoModel
     {
         Model   = this,
         Context = Context
     };
     NormalCode = new NormalCodeModel
     {
         Model   = this,
         Context = Context
     };
     Editor = new EditorModel
     {
         Model   = this,
         Context = Context
     };
     Editor.CreateMenus(this);
     ExtendConfig.Editor = Editor;
     Context.Editor      = Editor;
     ConfigIo.Editor     = Editor;
     NormalCode.Editor   = Editor;
     Tree.Editor         = Editor;
 }
Esempio n. 4
0
        /// <summary>
        /// 新增解决方案
        /// </summary>
        public void CreateNew()
        {
            var sfd = new SaveFileDialog
            {
                Filter = fileType
            };

            if (sfd.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }
            Context.Solution = new SolutionConfig
            {
                Name         = Path.GetFileNameWithoutExtension(sfd.FileName),
                Caption      = Path.GetFileNameWithoutExtension(sfd.FileName),
                SaveFileName = sfd.FileName
            };
            DataModelDesignModel.Screen.LastFile = sfd.FileName;
            SaveSolution();
            Load(sfd.FileName);
            DataModelDesignModel.SaveUserScreen();
        }
Esempio n. 5
0
        /// <summary>
        /// 构造
        /// </summary>
        public DataModelDesignModel()
        {
            Current = this;
            Context = new DesignContext();

            Global = new DesignGlobal
            {
                Model      = this,
                Dispatcher = Dispatcher,
                Context    = Context
            };
            GlobalConfig.SetGlobal(Global);
            ExtendConfig = new ExtendConfigModel
            {
                Model      = this,
                Dispatcher = Dispatcher,
                Context    = Context
            };
            Tree = new TreeModel
            {
                Model      = this,
                Dispatcher = Dispatcher,
                Context    = Context
            };
            ConfigIo = new ConfigIoModel
            {
                Model      = this,
                Dispatcher = Dispatcher,
                Context    = Context
            };
            NormalCode = new NormalCodeModel
            {
                Model      = this,
                Dispatcher = Dispatcher,
                Context    = Context
            };
        }
Esempio n. 6
0
 public void CreateMenus(DataModelDesignModel model)
 {
     Menus = CreateMenus();
 }