Exemplo n.º 1
0
        public MainWindowViewModel(IApplicationMessageEvent applicationMessageEvent, IPomodoro pomodoro)
        {
            // setup for ApplicationMessageEvent to communicate with other viewmodels and views
            Messenger = applicationMessageEvent;
            Subject  += ((IApplicationMessage m) => m.Execute(this));

            this.pomodoro                 = pomodoro;
            pomodoro.OnSwitchToBreak     += new Action(OnSwitchToBreakEvent);
            pomodoro.OnSwitchToTask      += new Action(OnSwitchToTaskEvent);
            pomodoro.OnSwitchToLongBreak += new Action(OnSwitchToLongBreakEvent);
            pomodoro.OnCompletePomodoro  += new Action(OnCompletePomodoroEvent);

            tickTimer           = new TickTimer(50);
            tickTimer.OnTick   += new Action(OnTick);
            MainButtonCommand   = new StartCommand(this);
            ConfigButtonCommand = new ConfigButtonCommandImpl(applicationMessageEvent);

            InitializeBackgroundColor();
        }
Exemplo n.º 2
0
 public ServiceProvider()
 {
     configManager = new ConfigManager();
     pomodoro      = new Pomodoro();
     pomodoro.Configure(configManager);
 }
Exemplo n.º 3
0
 public void SetUpMainWindowViewModel()
 {
     pomodoro = Substitute.For <IPomodoro>();
     applicationController = Substitute.For <IApplicationController>();
     mainWindowViewModel   = new MainWindowViewModel(applicationController, pomodoro);
 }
Exemplo n.º 4
0
 public void SetPomodoro(IPomodoro pomodoro)
 {
     this.pomodoro = pomodoro;
 }