Пример #1
0
 private void OnTimerRestart()
 {
     BaseStatesStore.Revert();
     ActivityDataGrid.AddRow((int)TimerValuesStore.Timelapse, BaseStatesStore.IsWork);
     ActivityManager.Create(TimerValuesStore.Timelapse, BaseStatesStore.IsWork);
     _timerService.Set(TimerValuesStore.Timelapse, TimerValuesStore.TickInterval);
     TimerTickProgress.Maximum = TimerValuesStore.Timelapse;
 }
Пример #2
0
 private void OnTimerStart(object sender, RoutedEventArgs e)
 {
     if (_timerService.IsActive)
     {
         _timerService.Stop();
     }
     TimerStatesStore.CurrentState = TimerStatesStore.States.Work;
     TimerTickProgress.Maximum     = TimerValuesStore.Timelapse;
     ActivityDataGrid.AddRow((int)TimerValuesStore.Timelapse, BaseStatesStore.IsWork);
     ActivityManager.Create(TimerValuesStore.Timelapse, BaseStatesStore.IsWork);
     _timerService.Set(TimerValuesStore.Timelapse, TimerValuesStore.TickInterval);
     _timerService.Start();
 }
Пример #3
0
 private void Init()
 {
     _timerService = new TimerService();
     _timerService.Add(OnTimerTick, OnTimerRestart, () =>
     {
         // Add change toast
     });
     BaseStatesStore.Init(DefaultWorkState);
     ActivityDataGrid.FormDataGrid();
     AddLanguageChangedEvent(() => ActivityDataGrid.SetHeaders());
     ActivityManager.ToList(list =>
                            list.ForEach(activity => ActivityDataGrid.AddRow(activity.Duration, NoConversion, activity.Type)));
     TimerStatesStore.AddStateChangedEvent(ButtonVisibilityArea);
     ButtonVisibilityArea();
 }