Delete UpdatesSharing.cs

This commit is contained in:
Belim 2020-09-20 19:25:26 +02:00 committed by GitHub
parent 51a7a58ba8
commit 9a0cc16aea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,56 +0,0 @@
using Microsoft.Win32;
namespace Privatezilla.Setting.Updates
{
internal class DisableUpdatesSharing : SettingBase
{
private const string SharingKey = @"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\DeliveryOptimization";
private const int DesiredValue = 0;
public override string ID()
{
return Properties.Resources.settingsUpdatesUpdateSharing;
}
public override string Info()
{
return Properties.Resources.settingsUpdatesUpdateSharingInfo;
}
public override bool CheckSetting()
{
return !(
RegistryHelper.IntEquals(SharingKey, "DODownloadMode", DesiredValue)
);
}
public override bool DoSetting()
{
try
{
Registry.SetValue(SharingKey, "DODownloadMode", DesiredValue, RegistryValueKind.DWord);
return true;
}
catch
{ }
return false;
}
public override bool UndoSetting()
{
try
{
var RegKey = Registry.LocalMachine.OpenSubKey(@"Software\Policies\Microsoft\Windows\DeliveryOptimization", true);
RegKey.DeleteValue("DODownloadMode");
return true;
}
catch
{ }
return false;
}
}
}