public UndoTransaction(UndoManager undoManager, bool newTransaction)
        {
            if (newTransaction)
            {
                undoManager.Transactions.Clear();
            }
            undoManager.Transactions.Add(this);

            this.undoManager = undoManager;
            Debug.Assert(undoManager != null);
            this.undoManager.IsEnabled = false;
        }
        public MainWindowVM(EDOConfig config) {

//手動で英語環境のテストをしたい場合以下を有効にする

            Options.Init();
            this.config = config;
            recentFileList = new RecentFileList();
            List<string> files = recentFileList.RecentFiles;
            foreach (string file in files)
            {
                Debug.WriteLine(file);
            }

            edoUnits = new ObservableCollection<EDOUnitVM>();
            undoManager = new UndoManager();
            undoManager.UndoBufferCount = config.UndoBufferCount;
            undoManager.ModelChangeHandler += OnModelChanged;
            if (config.ReopenLastFile && File.Exists(config.LastFile))
            {
                DoOpen(false, config.LastFile);
            }
            if (edoModel == null)
            {
                edoModel = EDOModel.createDefault();
                createViewModels(edoModel);
                undoManager.Init(edoModel, this);
                UpdateRecentFiles();
            }

            this.HelpCommand = new HelpCommandImpl(this);
            this.AddCommand = new AddCommandImpl(this);
            this.StatusMessage = "Ready";
            this.IsErrorMessage = true;
            this.Title = DEFAULT_TITLE;
            this.IsTextBoxChanged = false;
//            var xdoc = XDocument.Parse(Resources.Options);
//            Debug.WriteLine(xdoc.ToString());
            this.isRestarting = false;
        }
Exemple #3
0
 public UndoTransaction(UndoManager undoManager) : this(undoManager, false)
 {
 }
 public UndoTransaction(UndoManager undoManager)
     : this(undoManager, false)
 {
 }