Delete DisableBing.cs
This commit is contained in:
parent
2cae94d351
commit
bad94b46d9
1 changed files with 0 additions and 64 deletions
|
@ -1,64 +0,0 @@
|
|||
using Microsoft.Win32;
|
||||
|
||||
namespace Privatezilla.Setting.Cortana
|
||||
{
|
||||
internal class DisableBing : SettingBase
|
||||
{
|
||||
private const string BingKey = @"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Windows Search";
|
||||
private const string Bing2004Key = @"HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer"; // Disable Websearch on Windows 10, version >=2004
|
||||
private const int DesiredValue = 0;
|
||||
|
||||
public override string ID()
|
||||
{
|
||||
return Properties.Resources.settingsCortanaDisableBing;
|
||||
}
|
||||
|
||||
public override string Info()
|
||||
{
|
||||
return Properties.Resources.settingsCortanaDisableBingInfo;
|
||||
}
|
||||
|
||||
public override bool CheckSetting()
|
||||
|
||||
{
|
||||
string releaseid = Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "ReleaseId", "").ToString();
|
||||
|
||||
if (releaseid != "2004")
|
||||
return !(RegistryHelper.IntEquals(BingKey, "BingSearchEnabled", DesiredValue));
|
||||
|
||||
else
|
||||
return !(RegistryHelper.IntEquals(Bing2004Key, "DisableSearchBoxSuggestions", 1));
|
||||
|
||||
}
|
||||
|
||||
|
||||
public override bool DoSetting()
|
||||
{
|
||||
try
|
||||
{
|
||||
Registry.SetValue(BingKey, "BingSearchEnabled", DesiredValue, RegistryValueKind.DWord);
|
||||
Registry.SetValue(Bing2004Key, "DisableSearchBoxSuggestions", 1, RegistryValueKind.DWord);
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool UndoSetting()
|
||||
{
|
||||
try
|
||||
{
|
||||
Registry.SetValue(BingKey, "BingSearchEnabled", 1, RegistryValueKind.DWord);
|
||||
Registry.SetValue(Bing2004Key, "DisableSearchBoxSuggestions", 0, RegistryValueKind.DWord);
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue