public TrayMenuController(ITrayMenu menu, ApplicationContext app, IPomodoroEngine pomodoroEngine, IEventHub eventHub) { this.menu = menu; this.app = app; this.pomodoroEngine = pomodoroEngine; menu.OnStartPomodoroClick(OnStartPomodoroClick); menu.OnStartLongBreakClick(OnStartLongBreakClick); menu.OnStartShortBreakClick(OnStartShortBreakClick); menu.OnStopTimerClick(OnStopTimerClick); menu.OnResetPomodoroCountClick(OnResetPomodoroCountClick); menu.OnExitClick(OnExitClick); eventHub.Subscribe <TimerStarted>(OnTimerStarted); eventHub.Subscribe <TimerStopped>(OnTimerStopped); eventHub.Subscribe <TimeElapsed>(OnTimeElasped); eventHub.Subscribe <PomodoroCountChanged>(OnPomodoroCountChanged); menu.Update(mutator => { mutator.UpdateRemainingTime(Duration.Zero.ToTimeString()); mutator.UpdatePomodoroCount(0); mutator.EnableStopTimerItem(false); }); }
public void SetUp() { userPreferences = Substitute.For <IUserPreferences>(); timer = Substitute.For <ITimer>(); eventHub = new FakeEventHub(); engine = new PomodoroEngine(timer, userPreferences, eventHub); }
public YapaTheme(IMainViewModel viewModel, YapaThemeSettings settings, IPomodoroEngine engine, ISettings globalSettings, IPomodoroRepository pomodoroRepository, PomodoroEngineSettings engineSettings) : base(viewModel) { ViewModel = viewModel; Settings = settings; _pomodoroRepository = pomodoroRepository; _engineSettings = engineSettings; InitializeComponent(); TimerFlush = (Storyboard)TryFindResource("FlashTimer"); AfterBreakTimerFlush = (Storyboard)TryFindResource("AfterBreakFlashTimer"); PomodorosCompleted = 0; ViewModel.Engine.PropertyChanged += Engine_PropertyChanged; ViewModel.Engine.OnPomodoroCompleted += Engine_OnPomodoroCompleted; ViewModel.Engine.OnStarted += StopAnimation; ViewModel.Engine.OnStopped += StopAnimation; globalSettings.PropertyChanged += _globalSettings_PropertyChanged; DataContext = this; UpdateAppSize(); PhaseChanged(); UpdateStatusText(); UpdateCompletedPomodoroCount(); PropertyChanged += YapaTheme_PropertyChanged; UpdateDisplayedTime(); UpdateSecondVisibility(); }
public PomodoroEngineSettingWindow(PomodoroEngineSettings settings, IPomodoroEngine engine, PomodoroProfileSettings profileSettings) { settings.DeferChanges(); InitializeComponent(); var counterValues = new List <CounterListItem> { new CounterListItem { Item = CounterEnum.CompletedThisSession, Title = "Completed this session" }, new CounterListItem { Item = CounterEnum.CompletedToday, Title = "Competed today" }, new CounterListItem { Item = CounterEnum.PomodoroIndex, Title = "Pomodoro index" }, }; CounterList.ItemsSource = counterValues; Settings = settings; Engine = engine; DataContext = this; ProfileSetting.Children.Clear(); ProfileSetting.Children.Add(profileSettings); }
public NotificationsPresenter(IPomodoroEngine pomodoroEngine, IUserPreferences userPreferences, IEventHub eventHub) { this.pomodoroEngine = pomodoroEngine; this.userPreferences = userPreferences; eventHub.Subscribe <TimerStopped>(OnTimerStopped); eventHub.Subscribe <AppUpdated>(OnAppUpdated); eventHub.Subscribe <FirstRun>(OnFirstRun); }
public Dashboard(IPomodoroEngine engine, IPomodoroRepository itemRepository, PomodoroEngineSettings engineSettings) { _itemRepository = itemRepository; _engineSettings = engineSettings; _engine = engine; _engine.OnPomodoroCompleted += _engine_OnPomodoroCompleted; }
public MusicPlayer(IPomodoroEngine engine, MusicPlayerPluginSettings settings, IMusicPlayer musicPlayer, PomodoroEngineSettings engineSettings) { _engine = engine; _settings = settings; _musicPlayer = musicPlayer; _engineSettings = engineSettings; _engine.PropertyChanged += _engine_PropertyChanged; }
public SoundNotifications(IPomodoroEngine engine, SoundNotificationsSettings settings, IMusicPlayer musicPlayer, PomodoroEngineSettings engineSettings) { _engine = engine; _settings = settings; _musicPlayer = musicPlayer; _engineSettings = engineSettings; _engine.PropertyChanged += _engine_PropertyChanged; }
public MainViewModel(IPomodoroEngine engine, IShowSettingsCommand showSettings) { Engine = engine; StopCommand = new StopCommand(Engine); StartCommand = new StartCommand(Engine); ResetCommand = new ResetCommand(Engine); PauseCommand = new PauseCommand(Engine); SkipCommand = new SkipCommand(Engine); ShowSettingsCommand = showSettings; }
public UnclickablePlugin(IApplication app, IPomodoroEngine engine, UnclickableSettings settings, ISettings globalSettings) { _engine = engine; _settings = settings; _globalSettings = globalSettings; _window = (Window)app; _app = app; _engine.PropertyChanged += _engine_PropertyChanged; _window.Loaded += (sender, args) => SaveInitialStyle(); _window.MouseEnter += _window_MouseEnter; _globalSettings.PropertyChanged += _globalSettings_PropertyChanged;; }
public TimerWindowPresenter(IPomodoroEngine pomodoroEngine, ICountdownClock countdownClock, IEventHub eventHub) { this.countdownClock = countdownClock; idleState = new IdleState(pomodoroEngine); pomodoroState = new PomodoroState(pomodoroEngine); shortBreakState = new ShortBreakState(pomodoroEngine); longBreakState = new LongBreakState(pomodoroEngine); pomodoroCompletedState = new PomodoroCompletedState(pomodoroEngine); breakFinishedState = new BreakFinishedState(pomodoroEngine); pomodoroInterruptedState = new TimerInterruptedState("Pomodoro Interrupted", pomodoroEngine); breakInterruptedState = new TimerInterruptedState("Break Interrupted", pomodoroEngine); currentState = idleState; eventHub.Subscribe <TimerStarted>(OnTimerStarted); eventHub.Subscribe <TimeElapsed>(OnTimeElapsed); eventHub.Subscribe <TimerStopped>(OnTimerStopped); }
public PomodoroProfileSettings(PomodoroEngineSettings settings, IPomodoroEngine engine) { settings.DeferChanges(); InitializeComponent(); var oneHour = Enumerable.Range(1, 60).Reverse().ToList(); WorkTimeSelect.ItemsSource = oneHour; BreakTimeSelect.ItemsSource = oneHour; LongBreakTimeSelect.ItemsSource = oneHour; Settings = settings; Engine = engine; Engine.PropertyChanged += Engine_PropertyChanged; Unloaded += PomodoroProfileSettings_Unloaded; DataContext = this; ActiveProfileSelect.ItemsSource = Profiles; ActiveProfileSelect.SelectionChanged += ActiveProfile_SelectectionChanged; RefreshProfilesList(); }
public SkipCommand(IPomodoroEngine engine) { _engine = engine; _engine.PropertyChanged += _engine_PropertyChanged; }
public BreakFinishedState(IPomodoroEngine pomodoroEngine) { this.pomodoroEngine = pomodoroEngine; }
public TimerInterruptedState(string title, IPomodoroEngine pomodoroEngine) { this.title = title; this.pomodoroEngine = pomodoroEngine; }
public PomodoroCompletedState(IPomodoroEngine pomodoroEngine) { this.pomodoroEngine = pomodoroEngine; }
public LongBreakState(IPomodoroEngine pomodoroEngine) { this.pomodoroEngine = pomodoroEngine; }
public NotificationsPresenter(IPomodoroEngine pomodoroEngine, IEventHub eventHub) { this.pomodoroEngine = pomodoroEngine; eventHub.Subscribe <TimerStopped>(OnTimerStopped); }
public ShortBreakState(IPomodoroEngine pomodoroEngine) { this.pomodoroEngine = pomodoroEngine; }
public PomodoroState(IPomodoroEngine pomodoroEngine) { this.pomodoroEngine = pomodoroEngine; }