Beispiel #1
0
        /// <summary>
        /// Invoked when the "New timer" <see cref="MenuItem"/> is clicked.
        /// </summary>
        /// <param name="sender">The <see cref="MenuItem"/> where the event handler is attached.</param>
        /// <param name="e">The event data.</param>
        private void NewTimerMenuItemClick(object sender, RoutedEventArgs e)
        {
            TimerWindow window = new TimerWindow();

            window.RestoreFromWindow(this.timerWindow);
            window.Show();
        }
Beispiel #2
0
        /// <summary>
        /// Shows an existing <see cref="Timer"/> in a new <see cref="TimerWindow"/>.
        /// </summary>
        /// <param name="savedTimer">An existing <see cref="Timer"/>.</param>
        private void ShowSavedTimerInNewWindow(Timer savedTimer)
        {
            TimerWindow newTimerWindow = new TimerWindow();

            if (savedTimer.Options.WindowSize != null)
            {
                newTimerWindow.Restore(savedTimer.Options.WindowSize);
            }
            else
            {
                newTimerWindow.RestoreFromWindow(this.timerWindow);
            }

            newTimerWindow.Show(savedTimer);
        }
Beispiel #3
0
        /// <summary>
        /// Invoked when a recent <see cref="TimerStart"/> <see cref="MenuItem"/> is clicked.
        /// </summary>
        /// <param name="sender">The <see cref="MenuItem"/> where the event handler is attached.</param>
        /// <param name="e">The event data.</param>
        private void RecentInputMenuItemClick(object sender, RoutedEventArgs e)
        {
            MenuItem   menuItem   = (MenuItem)sender;
            TimerStart timerStart = (TimerStart)menuItem.Tag;

            TimerWindow window;

            if (this.timerWindow.Timer.State == TimerState.Stopped || this.timerWindow.Timer.State == TimerState.Expired)
            {
                window = this.timerWindow;
            }
            else
            {
                window = new TimerWindow();
                window.Options.Set(this.timerWindow.Options);
                window.RestoreFromWindow(this.timerWindow);
            }

            window.Show(timerStart);
        }