コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: socialpercon/YAPA
 private void Window_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
 {
     GetMainWindowPosAndSaveSettings();
     ShowSettings.Execute(this);
 }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: socialpercon/YAPA
        public bool ProcessCommandLineArgs(params string[] args)
        {
            if (args == null || args.Length == 0)
            {
                return(true);
            }

            if ((args.Length > 1))
            {
                //the first index always contains the location of the exe so we need to check the second index
                if ((args[1].ToLowerInvariant() == "/start"))
                {
                    if (!_stopWatch.IsRunning)
                    {
                        if (SoundEffects)
                        {
                            _tickSound.Play();
                        }
                        TimerFlush.Stop(this);
                        _stopWatch.Start();
                        _dispacherTime.Start();
                        if (_isWork)
                        {
                            _period++;
                        }
                    }
                }
                else if ((args[1].ToLowerInvariant() == "/pause"))
                {
                    if (SoundEffects)
                    {
                        _tickSound.Stop();
                        _ringSound.Stop();
                    }
                    if (_stopWatch.IsRunning)
                    {
                        _period--;
                        _stopWatch.Stop();
                        ProgressState = "Paused";
                    }
                }
                else if ((args[1].ToLowerInvariant() == "/restart"))
                {
                    if (_stopWatch.IsRunning)
                    {
                        if (SoundEffects)
                        {
                            _tickSound.Play();
                        }
                        _ticks = 0;
                        _stopWatch.Restart();
                    }
                }
                else if ((args[1].ToLowerInvariant() == "/reset"))
                {
                    ResetTicking();
                }
                else if ((args[1].ToLowerInvariant() == "/settings"))
                {
                    ShowSettings.Execute(this);
                }
                else if ((args[1].ToLowerInvariant() == "/homepage"))
                {
                    Process.Start("http://lukaszbanasiak.github.io/YAPA/");
                }
            }

            return(true);
        }
コード例 #3
0
ファイル: MainWindow.xaml.cs プロジェクト: tobiasschuerg/YAPA
 private void Window_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
 {
     ShowSettings.Execute(this);
 }