Delete InventoryCollector.cs

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

View file

@ -1,58 +0,0 @@
using Microsoft.Win32;
namespace Privatezilla.Setting.Privacy
{
internal class InventoryCollector : SettingBase
{
private const string InventoryKey = @"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\AppCompat";
private const string AppTelemetryKey = @"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\AppCompat";
private const int DesiredValue = 1;
public override string ID()
{
return Properties.Resources.settingsPrivacyInventoryCollector;
}
public override string Info()
{
return Properties.Resources.settingsPrivacyInventoryCollectorInfo.Replace("\\n", "\n");
}
public override bool CheckSetting()
{
return !(
RegistryHelper.IntEquals(InventoryKey, "DisableInventory", DesiredValue) &&
RegistryHelper.IntEquals(AppTelemetryKey, "AITEnable", 0)
);
}
public override bool DoSetting()
{
try
{
Registry.SetValue(InventoryKey, "DisableInventory", DesiredValue, RegistryValueKind.DWord);
Registry.SetValue(AppTelemetryKey, "AITEnable", 0, RegistryValueKind.DWord);
return true;
}
catch
{ }
return false;
}
public override bool UndoSetting()
{
try
{
Registry.SetValue(InventoryKey, "DisableInventory", 0, RegistryValueKind.DWord);
Registry.SetValue(AppTelemetryKey, "AITEnable", 1, RegistryValueKind.DWord);
return true;
}
catch
{ }
return false;
}
}
}