Delete DisableTelemetry.cs

This commit is contained in:
Belim 2020-09-20 19:23:56 +02:00 committed by GitHub
parent fa3a47deeb
commit e4733813e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,62 +0,0 @@
using Microsoft.Win32;
namespace Privatezilla.Setting.Privacy
{
internal class DisableTelemetry : SettingBase
{
private const string TelemetryKey = @"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\DataCollection";
private const string DiagTrack = @"HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\DiagTrack";
private const string dmwappushservice = @"HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\dmwappushservice";
private const int DesiredValue = 0;
public override string ID()
{
return Properties.Resources.settingsPrivacyDisableTelemetry;
}
public override string Info()
{
return Properties.Resources.settingsPrivacyDisableTelemetryInfo.Replace("\\n", "\n");
}
public override bool CheckSetting()
{
return !(
RegistryHelper.IntEquals(TelemetryKey, "AllowTelemetry", DesiredValue) &&
RegistryHelper.IntEquals(DiagTrack, "Start", 4) &&
RegistryHelper.IntEquals(dmwappushservice, "Start", 4)
);
}
public override bool DoSetting()
{
try
{
Registry.SetValue(TelemetryKey, "AllowTelemetry", DesiredValue, RegistryValueKind.DWord);
Registry.SetValue(DiagTrack, "Start", 4, RegistryValueKind.DWord);
Registry.SetValue(dmwappushservice, "Start", 4, RegistryValueKind.DWord);
return true;
}
catch
{ }
return false;
}
public override bool UndoSetting()
{
try
{
Registry.SetValue(TelemetryKey, "AllowTelemetry", 3, RegistryValueKind.DWord);
Registry.SetValue(DiagTrack, "Start", 2, RegistryValueKind.DWord);
Registry.SetValue(dmwappushservice, "Start", 2, RegistryValueKind.DWord);
return true;
}
catch
{ }
return false;
}
}
}