private void UpdateIU(UiUpdatedEventArgs e)
        {
            if (e == null)
            {
                return;
            }
            if (e.Time.HasValue)
            {
                Text = e.Time.Value.ToString(Config.TimeFormat, CultureInfo.InvariantCulture);
            }
            if (e.PrimaryBtn.HasValue)
            {
                switch (e.PrimaryBtn.Value)
                {
                case PrimaryButtonMode.Running:
                    PrimaryButtonText = Config.PrimaryButtonStop;
                    ChangeButtonRed();
                    _ui.ChangeWindowTitle(Config.WindowTitleRunning);
                    break;

                case PrimaryButtonMode.Stopped:
                    PrimaryButtonText = Config.PrimaryButtonStart;
                    ChangeButtonBlue();
                    _ui.ChangeWindowTitle(Config.WindowTitle);
                    break;

                default:
                    PrimaryButtonText = e.PrimaryBtn.Value.ToString();
                    break;
                }
            }
        }
Esempio n. 2
0
 private void Timer_Finished(object sender, UiUpdatedEventArgs e)
 {
     lock (_lock)
     {
         _sound.Stop();
     }
 }
 private void Clock_TickHappened(object sender, UiUpdatedEventArgs e)
 {
     //runs on UI thread
     UpdateIU(e);
 }
Esempio n. 4
0
 private void Clock_Finished(object sender, UiUpdatedEventArgs e)
 {
     //runs on UI thread
     _sound.Play(Config.TimerBeepingSeconds);
     UpdateIU(e, true);
 }