Esempio n. 1
0
        private void OnConfigLoaded(OnConfigLoadedMessage message)
        {
            var configData = message.Data;

            enableDebugLoggingCheck.Checked = configData.EnableDebugLog;
            wakeStateCheck.Checked          = configData.SaveBacklightState;
            keyboardCorePathText.Text       = configData.KeyboardCorePath;
            timeoutUpDown.Value             = configData.TimeoutPreference;
            radioLow.Checked            = configData.LightLevel == LightLevel.Low;
            radioHigh.Checked           = configData.LightLevel == LightLevel.High;
            monitorDisplayState.Checked = configData.MonitorDisplayState;
            var fileInfo     = new FileInfo(configData.KeyboardCorePath);
            var kbCoreParent = fileInfo.DirectoryName;

            openFileDialog.InitialDirectory = kbCoreParent;
            openFileDialog.FileName         = fileInfo.Name;

            if (configData.TimeoutPreference > 0)
            {
                _idleTimer.SetTimer(configData.TimeoutPreference);
            }
            else
            {
                _idleTimer.StopTimer();
            }
            if (configData.MonitorDisplayState)
            {
                _displayHook.EnableHook();
            }
            else
            {
                _displayHook.DisableHook();
            }
        }
 private void OnConfigLoaded(OnConfigLoadedMessage message)
 {
     _logger.EnableDebugLog = message.Data.EnableDebugLog;
     if (_logger.EnableDebugLog)
     {
         _logger.Debug("Debug log enabled.");
     }
 }