Delete DisableTips.cs

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

View file

@ -1,67 +0,0 @@
using Microsoft.Win32;
namespace Privatezilla.Setting.Privacy
{
internal class DisableTips: SettingBase
{
private const string DisableSoftLanding = @"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\CloudContent";
private const string DisableWindowsSpotlightFeatures = @"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\CloudContent";
private const string DisableWindowsConsumerFeatures = @"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\CloudContent";
private const string DoNotShowFeedbackNotifications = @"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\DataCollection";
private const int DesiredValue = 1;
public override string ID()
{
return Properties.Resources.settingsPrivacyDisableTips;
}
public override string Info()
{
return Properties.Resources.settingsPrivacyDisableTipsInfo;
}
public override bool CheckSetting()
{
return !(
RegistryHelper.IntEquals(DisableSoftLanding, "DisableSoftLanding", DesiredValue) &&
RegistryHelper.IntEquals(DisableWindowsSpotlightFeatures, "DisableWindowsSpotlightFeatures", DesiredValue) &&
RegistryHelper.IntEquals(DisableWindowsConsumerFeatures, "DisableWindowsConsumerFeatures", DesiredValue) &&
RegistryHelper.IntEquals(DoNotShowFeedbackNotifications, "DoNotShowFeedbackNotifications", DesiredValue)
);
}
public override bool DoSetting()
{
try
{
Registry.SetValue(DisableSoftLanding, "DisableSoftLanding", DesiredValue, RegistryValueKind.DWord);
Registry.SetValue(DisableWindowsSpotlightFeatures, "DisableWindowsSpotlightFeatures", DesiredValue, RegistryValueKind.DWord);
Registry.SetValue(DisableWindowsConsumerFeatures, "DisableWindowsConsumerFeatures", DesiredValue, RegistryValueKind.DWord);
Registry.SetValue(DoNotShowFeedbackNotifications, "DoNotShowFeedbackNotifications", DesiredValue, RegistryValueKind.DWord);
return true;
}
catch
{ }
return false;
}
public override bool UndoSetting()
{
try
{
Registry.SetValue(DisableSoftLanding, "DisableSoftLanding", 0, RegistryValueKind.DWord);
Registry.SetValue(DisableWindowsSpotlightFeatures, "DisableWindowsSpotlightFeatures", 0, RegistryValueKind.DWord);
Registry.SetValue(DisableWindowsConsumerFeatures, "DisableWindowsConsumerFeatures", 0, RegistryValueKind.DWord);
Registry.SetValue(DoNotShowFeedbackNotifications, "DoNotShowFeedbackNotifications", 0, RegistryValueKind.DWord);
return true;
}
catch
{ }
return false;
}
}
}