//LOG.WarnFormat("Restoring default hotkey for {0}, stored under {1} from '{2}' to '{3}'", functionName, configurationKey, hotkeyValue.Value, hotkeyValue.Attributes.DefaultValue);
// when getting an exception the key wasn't found: reset the hotkey value
/// Registers all hotkeys as configured, displaying a dialog in case of hotkey conflicts with other tools.
/// </summary>
/// <returns>Whether the hotkeys could be registered to the users content. This also applies if conflicts arise and the user decides to ignore these (i.e. not to register the conflicting hotkey).</returns>
publicstaticboolRegisterHotkeys()
{
returnRegisterHotkeys(false);
}
staticvoidTEST()
{
MessageBox.Show("TEST");
}
/// <summary>
/// Registers all hotkeys as configured, displaying a dialog in case of hotkey conflicts with other tools.
/// </summary>
/// <param name="ignoreFailedRegistration">if true, a failed hotkey registration will not be reported to the user - the hotkey will simply not be registered</param>
/// <returns>Whether the hotkeys could be registered to the users content. This also applies if conflicts arise and the user decides to ignore these (i.e. not to register the conflicting hotkey).</returns>
// if failures have been ignored, the config has probably been updated
//if (_conf.IsDirty)
//{
// IniConfig.Save();
//}
}
}
returnsuccess||ignoreFailedRegistration;
}
///// <summary>
///// Check if OneDrive is blocking hotkeys
///// </summary>
///// <returns>true if onedrive has hotkeys turned on</returns>
//private static bool IsOneDriveBlockingHotkey()
//{
// if (!Environment.OSVersion.IsWindows10())
// {
// return false;
// }
// var localAppData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
// var oneDriveSettingsPath = Path.Combine(localAppData, @"Microsoft\OneDrive\settings\Personal");
// if (!Directory.Exists(oneDriveSettingsPath))
// {
// return false;
// }
// var oneDriveSettingsFile = Directory.GetFiles(oneDriveSettingsPath, "*_screenshot.dat").FirstOrDefault();
// if (!File.Exists(oneDriveSettingsFile))
// {
// return false;
// }
// var screenshotSetting = File.ReadAllLines(oneDriveSettingsFile).Skip(1).Take(1).First();
// return "2".Equals(screenshotSetting);
//}
/// <summary>
/// Displays a dialog for the user to choose how to handle hotkey registration failures:
/// retry (allowing to shut down the conflicting application before),
/// ignore (not registering the conflicting hotkey and resetting the respective config to "None", i.e. not trying to register it again on next startup)
/// abort (do nothing about it)
/// </summary>
/// <param name="failedKeys">comma separated list of the hotkeys that could not be registered, for display in dialog text</param>