Delete DisableTipsLockScreen.cs

This commit is contained in:
Belim 2020-09-20 19:24:38 +02:00 committed by GitHub
parent 7215c59e64
commit 7ac0d98820
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,64 +0,0 @@
using Microsoft.Win32;
namespace Privatezilla.Setting.Privacy
{
internal class DisableTipsLockScreen : SettingBase
{
private const string SpotlightKey = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager";
private const string LockScreenKey = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager";
private const string TipsTricksSuggestions = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager";
private const int DesiredValue = 0;
public override string ID()
{
return Properties.Resources.settingsPrivacyDisableTipsLockScreen;
}
public override string Info()
{
return Properties.Resources.settingsPrivacyDisableTipsLockScreenInfo;
}
public override bool CheckSetting()
{
return !(
RegistryHelper.IntEquals(SpotlightKey, "RotatingLockScreenEnabled", DesiredValue) &&
RegistryHelper.IntEquals(LockScreenKey, "RotatingLockScreenOverlayEnabled", DesiredValue) &&
RegistryHelper.IntEquals(TipsTricksSuggestions, "SubscribedContent-338389Enabled", DesiredValue)
);
}
public override bool DoSetting()
{
try
{
Registry.SetValue(SpotlightKey, "RotatingLockScreenEnabled", DesiredValue, RegistryValueKind.DWord);
Registry.SetValue(LockScreenKey, "RotatingLockScreenOverlayEnabled", DesiredValue, RegistryValueKind.DWord);
Registry.SetValue(TipsTricksSuggestions, "SubscribedContent-338389Enabled", DesiredValue, RegistryValueKind.DWord);
return true;
}
catch
{ }
return false;
}
public override bool UndoSetting()
{
try
{
Registry.SetValue(SpotlightKey, "RotatingLockScreenEnabled", 1, RegistryValueKind.DWord);
Registry.SetValue(LockScreenKey, "RotatingLockScreenOverlayEnabled", 1, RegistryValueKind.DWord);
Registry.SetValue(TipsTricksSuggestions, "SubscribedContent-338389Enabled", 1, RegistryValueKind.DWord);
return true;
}
catch
{ }
return false;
}
}
}