Esempio n. 1
0
 private WindowController Create(IConvenientWindowManager windowManager               = null,
                                 IEventAggregator eventAggregator                     = null,
                                 IAboutViewModel aboutViewModel                       = null,
                                 IMainWindowViewModel mainWindowViewModel             = null,
                                 IAttemptsPerWeekViewModel attemptsPerWeekViewModel   = null,
                                 IAttemptsViewModel attemptsViewModel                 = null,
                                 ICompletedLengthsViewModel completedLengthsViewModel = null,
                                 IKataCompletedViewModel kataCompletedViewModel       = null,
                                 IReminderSettingsViewModel reminderSettingsViewModel = null,
                                 IFeedbackViewModel feedbackViewModel                 = null)
 {
     return(new WindowController(
                windowManager ?? Substitute.For <IConvenientWindowManager>(),
                eventAggregator ?? Substitute.For <IEventAggregator>(),
                mainWindowViewModel ?? Substitute.For <IMainWindowViewModel>(),
                aboutViewModel ?? Substitute.For <IAboutViewModel>(),
                attemptsPerWeekViewModel ?? Substitute.For <IAttemptsPerWeekViewModel>(),
                attemptsViewModel ?? Substitute.For <IAttemptsViewModel>(),
                completedLengthsViewModel ?? Substitute.For <ICompletedLengthsViewModel>(),
                kataCompletedViewModel ?? Substitute.For <IKataCompletedViewModel>(),
                reminderSettingsViewModel ?? Substitute.For <IReminderSettingsViewModel>(),
                feedbackViewModel ?? Substitute.For <IFeedbackViewModel>()
                ));
 }
Esempio n. 2
0
        public WindowController(IConvenientWindowManager windowManager,
                                IEventAggregator eventAggregator,
                                IMainWindowViewModel mainWindowViewModel,
                                IAboutViewModel aboutViewModel,
                                IAttemptsPerWeekViewModel attemptsPerWeekViewModel,
                                IAttemptsViewModel attemptsViewModel,
                                ICompletedLengthsViewModel completedLengthsViewModel,
                                IKataCompletedViewModel kataCompletedViewModel,
                                IReminderSettingsViewModel reminderSettingsViewModel,
                                IFeedbackViewModel feedbackViewModel)
        {
            if (windowManager == null)
            {
                throw new ArgumentNullException(nameof(windowManager));
            }
            if (eventAggregator == null)
            {
                throw new ArgumentNullException(nameof(eventAggregator));
            }
            if (mainWindowViewModel == null)
            {
                throw new ArgumentNullException(nameof(mainWindowViewModel));
            }
            if (aboutViewModel == null)
            {
                throw new ArgumentNullException(nameof(aboutViewModel));
            }
            if (attemptsPerWeekViewModel == null)
            {
                throw new ArgumentNullException(nameof(attemptsPerWeekViewModel));
            }
            if (attemptsViewModel == null)
            {
                throw new ArgumentNullException(nameof(attemptsViewModel));
            }
            if (completedLengthsViewModel == null)
            {
                throw new ArgumentNullException(nameof(completedLengthsViewModel));
            }
            if (kataCompletedViewModel == null)
            {
                throw new ArgumentNullException(nameof(kataCompletedViewModel));
            }
            if (reminderSettingsViewModel == null)
            {
                throw new ArgumentNullException(nameof(reminderSettingsViewModel));
            }
            if (feedbackViewModel == null)
            {
                throw new ArgumentNullException(nameof(feedbackViewModel));
            }
            _windowManager             = windowManager;
            _eventAggregator           = eventAggregator;
            _mainWindowViewModel       = mainWindowViewModel;
            _aboutViewModel            = aboutViewModel;
            _attemptsPerWeekViewModel  = attemptsPerWeekViewModel;
            _attemptsViewModel         = attemptsViewModel;
            _completedLengthsViewModel = completedLengthsViewModel;
            _kataCompletedViewModel    = kataCompletedViewModel;
            _reminderSettingsViewModel = reminderSettingsViewModel;
            _feedbackViewModel         = feedbackViewModel;

            _eventAggregator.Subscribe(this);
        }