public void Stop()
 {
     _timer.Stop();
     NotifyOfPropertyChange(() => CanStart);
     NotifyOfPropertyChange(() => CanStop);
     NotifyOfPropertyChange(() => CanReset);
 }
        private async void DelayIdleTimer(object sender, EventArgs e)
        {
            idleTimer.Stop();
            speed = 0;

            idleWatch.Start();
            OnActive(false);

            await progressBarSpeed.ProgressTo(0, 500, Easing.Linear);
        }
Exemplo n.º 3
0
        private async void ExecuteMainButtonCommand()
        {
            if (!_hasStarted)
            {
                _hasStarted    = true;
                MainButtonText = "DONE";

                _timer.Start();
            }
            else
            {
                _timer.Stop();

                await _navigationService.NavigateAsync("GamePage");
            }
        }
Exemplo n.º 4
0
        private void ShowActions()
        {
            var actionForm = new ActionForm();

            actionForm.ShowDialog();

            switch (actionForm.ActionStateValue)
            {
            case ActionForm.ActionState.Stop:
                _timer.Stop();
                break;

            case ActionForm.ActionState.Continue:
                _timer.Resume();
                break;

            case ActionForm.ActionState.Minimize:
                ToggleVisibility();
                break;

            case ActionForm.ActionState.Interruption:
                _session.Interruptions++;
                _timer.Pause();
                break;
            }
        }
Exemplo n.º 5
0
    static void Main()
    {
        int i = 0;

        Console.WriteLine("Start timer result: " + i);
        CustomTimer t = new CustomTimer(delegate() { i++; Console.WriteLine(i); }, 500);

        t.Start();
        // do some work for 2seconds
        Thread.Sleep((int)2000);
        t.Stop();
        Console.WriteLine("Stop timer result: " + i);
    }
        private void TimerTick()
        {
            _timeLeft--;
            Time = _timeLeft.ToString();

            if (_timeLeft == 0)
            {
                _timer.Stop();
                ShowStartBtn = false;
                RaisePropertyChanged("ShowPicker");

                SelectedName = GlobalConfig.GenerateName();
            }
        }
Exemplo n.º 7
0
 public void setActive(bool state)
 {
     isActive = state;
     if (turboMode)
     {
         if (state)
         {
             timer.Start();
         }
         else
         {
             timer.Stop();
         }
     }
     if (state && !turboMode)
     {
         PlaySound();
     }
 }
Exemplo n.º 8
0
        private IEnumerator Start()
        {
            while (!MapboxAccess.Configured)
            {
                yield return(null);
            }
            var profiler = new CustomTimer().Start();

            foreach (var tileId in _map.Tiles)
            {
                var tile = new CustomTile(transform, _map, in tileId);
                _imageFactory.Register(tile);
//                _meshFactory.Register(tile);
            }

            while (CoroutineManager.Count > 0)
            {
                yield return(null);
            }
            Debug.Log(profiler.ElapsedSeconds.ToString(CultureInfo.CurrentCulture));
            profiler.Stop();
        }
 async void CPRIdle(object sender, EventArgs e)
 {
     timer.Stop();
     speed = 0;
     await idleTimer.Start();
 }
Exemplo n.º 10
0
 private void MenuItem_Click(object sender, System.Windows.RoutedEventArgs e)
 {
     CustomTimer.Stop();
 }
 private void MnuStop_Click(object sender, RoutedEventArgs e)
 {
     CustomTimer.Stop();
 }
Exemplo n.º 12
0
 public void resetQuack()
 {
     timerB.Stop();
     timerB.Start();
 }
Exemplo n.º 13
0
 /// <summary>
 /// Stop timer on GameOver
 /// </summary>
 void OnGameOver()
 {
     GameTimer.Stop();
 }