Пример #1
0
        private void GlobalHookKeyUp(object sender, KeyEventArgs e)
        {
            var config      = GetCurrentConfiguration();
            var combination = e.Serialize();

            _userLoggingService.LogLine(e.KeyCode.ToString());

            if (!_gamePresetService.IsRunning())
            {
                if (config.Shortcuts.TurnOnRed == combination)
                {
                    _userPresetService.ToggleRed();
                }
                if (config.Shortcuts.TurnOnGreen == combination)
                {
                    _userPresetService.ToggleGreen();
                }
                if (config.Shortcuts.TurnOnBlue == combination)
                {
                    _userPresetService.ToggleBlue();
                }
                if (config.Shortcuts.TurnOff == combination)
                {
                    _userPresetService.ToggleColor(false, false, false);
                }
            }
        }
Пример #2
0
        private void TabControl_Presets_Selecting(object sender, TabControlCancelEventArgs e)
        {
            if (TabControl_Presets.SelectedTab.Name == Tab_UserPreset.Name)
            {
                if (_gamePresetService.IsRunning())
                {
                    _gamePresetService.StopApplicationWatcher();
                    Button_StartGamePreset.Text = "Start";
                }

                _userPresetService.ToggleColor(Checkbox_Red.Checked, Checkbox_Green.Checked, Checkbox_Blue.Checked);
                ChangeMetroStyle();
            }
        }