public override void DisableHook() { if (!Settings.Enabled && currentColorFilterActive) { RegistryHandler.ColorFilterKeySender(false); currentColorFilterActive = false; } base.DisableHook(); }
private static void SetColorFilter(bool enabled, Theme newTheme) { if (enabled) { try { RegistryHandler.ColorFilterSetup(); if (newTheme == Theme.Dark) { RegistryHandler.ColorFilterKeySender(true); } else { RegistryHandler.ColorFilterKeySender(false); } } catch (Exception ex) { Logger.Error(ex, "could not enable color filter:"); } } }
protected override void HandleSwitch(Theme newTheme) { bool oldTheme = currentColorFilterActive; try { RegistryHandler.ColorFilterSetup(); if (newTheme == Theme.Dark) { RegistryHandler.ColorFilterKeySender(true); currentColorFilterActive = true; } else { RegistryHandler.ColorFilterKeySender(false); currentColorFilterActive = false; } } catch (Exception ex) { Logger.Error(ex, "could not enable color filter:"); } Logger.Info($"update info - previous: {oldTheme}, current: {currentColorFilterActive}, enabled: {Settings.Enabled}"); }