Пример #1
0
        /// <summary>
        /// Charge le scénario d'origine.
        /// </summary>
        protected virtual void LoadOriginalScenario(Scenario oldValue, Scenario newValue)
        {
            if (this.SelectedOriginalScenario != null)
            {
                this.SelectedOriginalActionItems = new BulkObservableCollection <GanttChartItem>();
                _originalActionsManager          = new GanttActionsManager(this.SelectedOriginalActionItems, null, null);
                _originalActionsManager.ChangeView(GanttGridView.WBS, null);

                _originalActionsManager.EnableReducedPercentageRefresh = false;

                _originalActionsManager.RegisterInitialActions(this.SelectedOriginalScenario.Actions, this.SelectedIESFilter.Value);

                UpdateOriginalRatio();
            }
            else
            {
                if (this.SelectedOriginalActionItems != null)
                {
                    this.SelectedOriginalActionItems.Clear();
                }
                if (_originalActionsManager != null)
                {
                    _originalActionsManager.Clear();
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Charge le scénario cible.
        /// </summary>
        protected virtual void LoadTargetScenario(Scenario oldValue, Scenario newValue)
        {
            if (this.SelectedTargetScenario != null)
            {
                if (this.SelectedTargetActionItems != null)
                {
                    this.SelectedTargetActionItems.Clear();
                }
                else
                {
                    this.SelectedTargetActionItems = new BulkObservableCollection <GanttChartItem>();
                }

                if (_targetActionsManager != null)
                {
                    _targetActionsManager.Clear();
                }
                else
                {
                    _targetActionsManager = new GanttActionsManager(this.SelectedTargetActionItems, null, null);
                    _targetActionsManager.ChangeView(GanttGridView.WBS, null);
                }

                var oldOriginalScenario = this.SelectedOriginalScenario;
                this.SelectedOriginalScenario   = null;
                this.AvailableOriginalScenarios = null;

                var originals = new List <Scenario>();
                var original  = this.SelectedTargetScenario.Original;
                while (original != null)
                {
                    originals.Add(original);
                    original = original.Original;
                }

                this.AvailableOriginalScenarios = originals.ToArray();

                this.SelectedOriginalScenario = this.AvailableOriginalScenarios.FirstOrDefault();

                _targetActionsManager.EnableReducedPercentageRefresh = false;

                _targetActionsManager.RegisterInitialActions(this.SelectedTargetScenario.Actions, this.SelectedIESFilter.Value);

                RestoreActionSelection();

                if (_navigationService != null && _navigationService.Preferences.TimelinePosition.HasValue)
                {
                    this.CurrentTimelinePosition = _navigationService.Preferences.TimelinePosition.Value;
                }

                UpdateOriginalRatio();
            }
            else
            {
                if (this.SelectedTargetActionItems != null)
                {
                    this.SelectedTargetActionItems.Clear();
                }
                if (_targetActionsManager != null)
                {
                    _targetActionsManager.Clear();
                }
            }
        }