Пример #1
0
        private void MenuSubItemPauseOnClick(object sender, EventArgs e)
        {
            ToolStripMenuItem btn = sender as ToolStripMenuItem;

            if (btn == null)
            {
                return;
            }

            string strPauseTimeSec = btn.Tag as string;

            if (string.IsNullOrEmpty(strPauseTimeSec))
            {
                strPauseTimeSec = "0";
            }

            if (double.TryParse(strPauseTimeSec, out var pauseSec) == false)
            {
                return;
            }

            if (pauseSec < 1)
            {
                if (TimeIntervalDialog.ShowInputTimeIntervalDialog(out pauseSec, App.Current.MainWindow) == false)
                {
                    return;
                }
            }

            GetMainViewModel().PauseCommand.Execute(pauseSec);
        }
Пример #2
0
        private void GuiButtonPause_OnClick(object sender, RoutedEventArgs e)
        {
            GuiPauseMenuPopup.IsOpen = false;

            Button btn = sender as Button;

            if (btn == null)
            {
                return;
            }

            string strPauseTimeSec = btn.Tag as string;

            if (string.IsNullOrEmpty(strPauseTimeSec))
            {
                strPauseTimeSec = "0";
            }

            if (double.TryParse(strPauseTimeSec, out var pauseSec) == false)
            {
                return;
            }

            if (pauseSec < 1)
            {
                if (TimeIntervalDialog.ShowInputTimeIntervalDialog(out pauseSec, App.Current.MainWindow) == false)
                {
                    return;
                }
            }

            ViewModel.PauseCommand.Execute(pauseSec);
        }