Esempio n. 1
0
        public void StartTimer(object sender, EventArgs e)
        {
            if (!_activity)
            {
                _activity = true;
                new Task(async() =>
                {
                    TimerText  = "8";
                    TimerColor = Constants.GreenColor;
                    for (int i = 8; i > 0; i--)
                    {
                        audioService.Tick();
                        TimerText = i.ToString();
                        await Task.Delay(1000);
                    }

                    TimerText  = "0";
                    TimerColor = Constants.RedColor;
                    audioService.Dong();

                    await Task.Delay(3000);
                    TimerText  = "Башла";
                    TimerColor = Constants.BlueColor;

                    _activity = false;
                }).Start();
            }
        }