Пример #1
0
        public PersistService(IRepository repository, IEventAggregator eventAggregator, CcdLevel currentLevel)
        {
            _repository = repository;

            currentLevel.Advanced += (s, e) => PersistData(null);
            eventAggregator.GetEvent<AdviceGivenEvent>().Subscribe(PersistData);
        }
Пример #2
0
        public Navigator(IRegionManager regionManager, IEventAggregator eventAggregator, CcdLevel currentLevel)
        {
            _regionManager = regionManager;
            _currentLevel = currentLevel;

            eventAggregator.GetEvent<RetrospectiveDoneEvent>().Subscribe(NavigateToShowAdviceView);
            eventAggregator.GetEvent<AdviceGivenEvent>().Subscribe(o => NavigateToCorrectCcdLevelsView());
            currentLevel.Advanced += (s, e) => NavigateToCorrectCcdLevelsView();
        }
Пример #3
0
        public HeaderViewModel(IEventAggregator eventAggregator, CcdLevel currentLevel)
        {
            _logger.Trace("Wiring events");
            _beginRetrospectiveEvent = eventAggregator.GetEvent<BeginRetrospectiveEvent>();

            eventAggregator.GetEvent<AdviceGivenEvent>().Subscribe(_ => DeceideIfRetrospectiveIsAvailable(currentLevel));
            currentLevel.Advanced += (s, e) => DeceideIfRetrospectiveIsAvailable(currentLevel);

            DeceideIfRetrospectiveIsAvailable(currentLevel);
        }
Пример #4
0
        private void Initialize()
        {
            Retrospectives = _persister.Load();
            var lastRetrospective = Retrospectives.FirstOrDefault();

            if (lastRetrospective == null)
                _currentLevel = new CcdLevel(Level.Black);
            else
                _currentLevel = lastRetrospective.Clone();
        }
Пример #5
0
        public AdviceViewModel(IEventAggregator eventAggregator,
                               IRepository repository,
                               IRalfWestphal ralfWestphal,
                               CcdLevel currentLevel)
        {
            _repository = repository;
            _ralfWestphal = ralfWestphal;
            _currentLevel = currentLevel;

            _logger.Trace("Wiring events");
            _adviceGivenEvent = eventAggregator.GetEvent<AdviceGivenEvent>();

            QueryRalfWestphal();
        }
Пример #6
0
        public CcdLevel Clone()
        {
            var clone = new CcdLevel(Level);

            for (int index = 0; index < Principles.Count; index++)
            {
                var principle = Principles[index];
                clone.Principles[index].EvaluationValue = principle.EvaluationValue;
            }

            for (int index = 0; index < Practices.Count; index++)
            {
                var practice = Practices[index];
                clone.Practices[index].EvaluationValue = practice.EvaluationValue;
            }

            return(clone);
        }
Пример #7
0
        public CcdLevel Clone()
        {
            var clone = new CcdLevel(Level);

            for (int index = 0; index < Principles.Count; index++)
            {
                var principle = Principles[index];
                clone.Principles[index].EvaluationValue = principle.EvaluationValue;
            }

            for (int index = 0; index < Practices.Count; index++)
            {
                var practice = Practices[index];
                clone.Practices[index].EvaluationValue = practice.EvaluationValue;
            }

            return clone;
        }
Пример #8
0
        public CcdLevelsViewModel(IEventAggregator eventAggregator, CcdLevel currentLevel)
        {
            _currentLevel = currentLevel;
            _currentLevel.Advanced += (s, e) =>
            {
                _logger.Trace("Principles and Practices have updated - tell it to the view.");
                OnPropertyChanged("CurrentLevel");
                OnPropertyChanged("Principles");
                OnPropertyChanged("Practices");
            };

            _logger.Trace("Wiring events");
            _retrospectiveDoneEvent = eventAggregator.GetEvent<RetrospectiveDoneEvent>();

            eventAggregator.GetEvent<BeginRetrospectiveEvent>().Subscribe(x =>
            {
                _logger.Trace("Let's begin the retrospective - switch to evaluation-mode");
                EvaluationVisible = true;
            });
        }
Пример #9
0
 public WhiteLevelViewModel(CcdLevel currentLevel)
 {
     _currentLevel = currentLevel;
 }
Пример #10
0
 private void DeceideIfRetrospectiveIsAvailable(CcdLevel currentLevel)
 {
     if (currentLevel.Level != Level.Black && currentLevel.Level != Level.White)
         RetrospectiveAvailable = true;
 }
Пример #11
0
 public BlackLevelViewModel(CcdLevel currentLevel)
 {
     _currentLevel = currentLevel;
 }