コード例 #1
0
        void StartGame()
        {
            GameSettings.IsEnabled = false;
            OnPlay.IsEnabled       = true;
            if (difficulty <= 10)
            {
                LetsPlayButton.Content = "Прекратить";
            }
            else if (difficulty <= 30)
            {
                LetsPlayButton.Content = "Сложновато, другие настройки!";
            }
            else if (difficulty <= 100)
            {
                LetsPlayButton.Content = "Я не Ванга, перенастроить";
            }
            else if (difficulty <= 1000)
            {
                LetsPlayButton.Content = "Остановить это безумие";
                StatusBar.Text         = "Если вы сможете победить, считайте что вы прошли эту игру!";
            }

            step = 0;

            AnswerText.Focus();
        }
コード例 #2
0
        public void RegistHotKey()
        {
            HotKeyRegister.UnRegistAllKeys();

            var preferences = PreferencesService.GetPreferences();

            HotKeyRegister.RegistKey(preferences.ShowHideShortcut.ModifierKeys, preferences.ShowHideShortcut.Key, (_, __) =>
            {
                if (Visibility == Visibility.Collapsed)
                {
                    Visibility = Visibility.Visible;
                    AnswerText.Focus();
                    return;
                }

                if (Visibility == Visibility.Visible)
                {
                    Visibility = Visibility.Collapsed;
                    return;
                }
            });
        }
コード例 #3
0
 private void SwichMode_Click(object sender, RoutedEventArgs e)
 {
     AnswerText.Focus();
 }
コード例 #4
0
 private void Window_ContentRendered(object sender, EventArgs e)
 {
     RegistHotKey();
     AnswerText.Focus();
 }