Ejemplo n.º 1
0
        /// <summary>
        /// Creates a new timer.
        /// </summary>
        public void AddTimer()
        {
            var timerViewModel = new TimerEditorViewModel {
                Timer = new CountdownTimer()
            };

            if (this.windowManager.ShowDialog(timerViewModel) == true)
            {
                this.timerManager.SaveTimer(timerViewModel.Timer);
            }

            this.ReloadTimers();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Edits the currently selected timer.
        /// </summary>
        public void EditTimer()
        {
            var timer = this.SelectedTimer as CountdownTimer;

            if (timer != null)
            {
                var timerViewModel = new TimerEditorViewModel {
                    Timer = timer
                };
                if (this.windowManager.ShowDialog(timerViewModel) == true)
                {
                    this.timerManager.SaveTimer(timerViewModel.Timer);
                }
            }

            this.ReloadTimers();
        }