Exemplo n.º 1
0
 public void RecordCoreState()
 {
     lock (m_Lock)
     {
         CoreState = GetCoreState();
     }
 }
Exemplo n.º 2
0
        public void RecordRedoUndo(Action action)
        {
            if (action is null)
            {
                throw new ArgumentNullException(nameof(action));
            }

            lock (m_Lock)
            {
                CoreStateModel before = CoreState;
                action();
                CoreStateModel after = GetCoreState();

                ClearRedoStack();
                m_UndoStack.Push(new UndoRedoCommandPair(
                                     new DelegateCommand <CoreStateModel>(ReplaceCoreState, CanReplaceCoreState), before,
                                     new DelegateCommand <CoreStateModel>(ReplaceCoreState, CanReplaceCoreState), after));

                RaiseCanExecuteChangedAllCommands();
            }
        }
Exemplo n.º 3
0
        private void SetCoreState(CoreStateModel coreState)
        {
            if (coreState is null)
            {
                return;
            }

            lock (m_Lock)
            {
                try
                {
                    IsBusy = true;

                    ClearManagedActivities();

                    m_ArrowGraphSettingsModel = coreState.ArrowGraphSettings;
                    m_ResourceSettingsModel   = coreState.ResourceSettings;

                    m_ProjectStart    = coreState.ProjectStart;
                    m_UseBusinessDays = coreState.UseBusinessDays;
                    m_ShowDates       = coreState.ShowDates;
                    RaisePropertyChanged(nameof(ProjectStart));
                    RaisePropertyChanged(nameof(UseBusinessDays));
                    RaisePropertyChanged(nameof(ShowDates));

                    AddManagedActivities(new HashSet <DependentActivityModel>(coreState.DependentActivities));

                    RunAutoCompile();

                    RecordCoreState();
                }
                finally
                {
                    IsBusy = false;
                }
            }
        }
Exemplo n.º 4
0
 private bool CanReplaceCoreState(CoreStateModel coreState)
 {
     return(true);
 }
Exemplo n.º 5
0
 private void ReplaceCoreState(CoreStateModel coreState)
 {
     SetCoreState(coreState);
 }