Portable Tool for an Ideal Windows Setup
C# activatorbloatware-removalcsharpdebloatdebloaterdisable-servicesmonitoring-systemportableprivacy-toolsregistry-tweakssystem-tuningsystem-utilitytelemetrytweakerwindows-10windows-11windows-debloatwindows-defenderwindows-optimizationwindows-tweaks
-refactoring
Greedeks6bbb083251bc
diff --git a/.Source/GTweak/Utilities/Helpers/INIManager.cs b/.Source/GTweak/Utilities/Helpers/INIManager.csindex f64e2c32..0e88d65a 100644--- a/.Source/GTweak/Utilities/Helpers/INIManager.cs+++ b/.Source/GTweak/Utilities/Helpers/INIManager.cs@@ -16,20 +16,29 @@ namespace GTweak.Utilities.Helpersprivate static extern int GetPrivateProfileSection(string section, StringBuilder retVal, int size, string filePath);private readonly string pathToConfig;- internal static Dictionary<string, string> configConfidentiality = new Dictionary<string, string>(),- configInterface = new Dictionary<string, string>(),- configServices = new Dictionary<string, string>(),- configSystem = new Dictionary<string, string>();+ internal static Dictionary<string, string>+ userTweaksConfidentiality = new Dictionary<string, string>(),+ userTweaksInterface = new Dictionary<string, string>(),+ userTweaksServices = new Dictionary<string, string>(),+ userTweaksSystem = new Dictionary<string, string>();internal INIManager(string iniPath) => pathToConfig = new FileInfo(iniPath).FullName.ToString();- internal string ReadConfig(string section, string key)+ internal string Read(string section, string key){StringBuilder retValue = new StringBuilder(255);GetPrivateProfileString(section, key, "", retValue, 255, pathToConfig);return retValue.ToString();}+ internal void Write(string section, string key, string value) => WritePrivateProfileString(section, key, value, pathToConfig);++ internal void WriteAll(string section, Dictionary<string, string> userTweaks)+ {+ foreach (KeyValuePair<string, string> addKeyValue in userTweaks)+ WritePrivateProfileString(section, addKeyValue.Key, addKeyValue.Value, pathToConfig);+ }+internal bool IsThereSection(string section){StringBuilder retValue = new StringBuilder(255);@@ -37,9 +46,6 @@ namespace GTweak.Utilities.Helpersreturn !string.IsNullOrEmpty(retValue.ToString());}- internal void WriteConfig(string section, string key, string value) => WritePrivateProfileString(section, key, value, pathToConfig);--[DllImport("kernel32.dll")]private static extern int GetPrivateProfileSection(string section, byte[] retVal, int size, string filePath);internal List<string> GetKeysOrValue(string section, bool isGetKey = true)diff --git a/.Source/GTweak/Utilities/Settings.cs b/.Source/GTweak/Utilities/Settings.csindex 6bf1be10..27cf9c91 100644--- a/.Source/GTweak/Utilities/Settings.cs+++ b/.Source/GTweak/Utilities/Settings.cs@@ -2,7 +2,6 @@using GTweak.Windows;using Microsoft.Win32;using System;-using System.Collections.Generic;using System.Diagnostics;using System.Globalization;using System.IO;@@ -103,7 +102,6 @@ namespace GTweak.Utilitiescase "HiddenIP":IsHiddenIpAddress = bool.Parse(registryKey?.GetValue("HiddenIP").ToString() ?? "False");break;-}registryKey.Close();});@@ -111,8 +109,8 @@ namespace GTweak.Utilitiesinternal static void SaveFileConfig(){- if (INIManager.configConfidentiality.Count == 0 && INIManager.configInterface.Count == 0- && INIManager.configServices.Count == 0 && INIManager.configSystem.Count == 0)+ if (INIManager.userTweaksConfidentiality.Count == 0 && INIManager.userTweaksInterface.Count == 0+ && INIManager.userTweaksServices.Count == 0 && INIManager.userTweaksSystem.Count == 0)new ViewNotification().Show("", (string)Application.Current.Resources["title1_notification"], (string)Application.Current.Resources["export_warning_notification"]);else@@ -139,20 +137,12 @@ namespace GTweak.UtilitiesFile.Delete(PathConfig);INIManager settingsFileINI = new INIManager(PathConfig);- settingsFileINI.WriteConfig("GTweak", "Author", "Greedeks");- settingsFileINI.WriteConfig("GTweak", "Release", "v4");-- foreach (KeyValuePair<string, string> addConfidentiality in INIManager.configConfidentiality)- settingsFileINI.WriteConfig("Confidentiality Tweaks", addConfidentiality.Key, addConfidentiality.Value);-- foreach (KeyValuePair<string, string> addInterface in INIManager.configInterface)- settingsFileINI.WriteConfig("Interface Tweaks", addInterface.Key, addInterface.Value);-- foreach (KeyValuePair<string, string> addServices in INIManager.configServices)- settingsFileINI.WriteConfig("Services Tweaks", addServices.Key, addServices.Value);-- foreach (KeyValuePair<string, string> addSystem in INIManager.configSystem)- settingsFileINI.WriteConfig("System Tweaks", addSystem.Key, addSystem.Value);+ settingsFileINI.Write("GTweak", "Author", "Greedeks");+ settingsFileINI.Write("GTweak", "Release", "v4");+ settingsFileINI.WriteAll("Confidentiality Tweaks", INIManager.userTweaksConfidentiality);+ settingsFileINI.WriteAll("Interface Tweaks", INIManager.userTweaksInterface);+ settingsFileINI.WriteAll("Services Tweaks", INIManager.userTweaksServices);+ settingsFileINI.WriteAll("System Tweaks", INIManager.userTweaksSystem);}catch (Exception ex) { Debug.WriteLine(ex.Message.ToString()); }}@@ -172,7 +162,7 @@ namespace GTweak.UtilitiesPathConfig = openFileDialog.FileName;INIManager settingsFileINI = new INIManager(PathConfig);- if (settingsFileINI.ReadConfig("GTweak", "Author").Contains("Greedeks") && settingsFileINI.ReadConfig("GTweak", "Release").Contains("v4"))+ if (settingsFileINI.Read("GTweak", "Author").Contains("Greedeks") && settingsFileINI.Read("GTweak", "Release").Contains("v4")){if (File.ReadLines(PathConfig).Any(line => line.Contains("TglButton")) || File.ReadLines(PathConfig).Any(line => line.Contains("Slider")))new ImportWindow().ShowDialog();diff --git a/.Source/GTweak/Utilities/Tweaks/ConfidentialityTweaks.cs b/.Source/GTweak/Utilities/Tweaks/ConfidentialityTweaks.csindex ac38a09d..9192bd5b 100644--- a/.Source/GTweak/Utilities/Tweaks/ConfidentialityTweaks.cs+++ b/.Source/GTweak/Utilities/Tweaks/ConfidentialityTweaks.cs@@ -255,8 +255,8 @@ namespace GTweak.Utilities.Tweaksinternal static void UseСonfidentiality(string tweak, bool isChoose){- INIManager.configConfidentiality.Remove(tweak);- INIManager.configConfidentiality.Add(tweak, Convert.ToString(isChoose));+ INIManager.userTweaksConfidentiality.Remove(tweak);+ INIManager.userTweaksConfidentiality.Add(tweak, Convert.ToString(isChoose));switch (tweak){diff --git a/.Source/GTweak/Utilities/Tweaks/InterfaceTweaks.cs b/.Source/GTweak/Utilities/Tweaks/InterfaceTweaks.csindex 6f7c816c..3b5f223f 100644--- a/.Source/GTweak/Utilities/Tweaks/InterfaceTweaks.cs+++ b/.Source/GTweak/Utilities/Tweaks/InterfaceTweaks.cs@@ -360,8 +360,8 @@ namespace GTweak.Utilities.Tweaksinternal static void UseInterface(string tweak, bool isChoose){- INIManager.configInterface.Remove(tweak);- INIManager.configInterface.Add(tweak, Convert.ToString(isChoose));+ INIManager.userTweaksInterface.Remove(tweak);+ INIManager.userTweaksInterface.Add(tweak, Convert.ToString(isChoose));switch (tweak){diff --git a/.Source/GTweak/Utilities/Tweaks/ServicesTweaks.cs b/.Source/GTweak/Utilities/Tweaks/ServicesTweaks.csindex 6c3ea8eb..4b833a7b 100644--- a/.Source/GTweak/Utilities/Tweaks/ServicesTweaks.cs+++ b/.Source/GTweak/Utilities/Tweaks/ServicesTweaks.cs@@ -364,8 +364,8 @@ namespace GTweak.Utilities.Tweaksinternal static void UseServices(string tweak, bool isChoose){- INIManager.configServices.Remove(tweak);- INIManager.configServices.Add(tweak, Convert.ToString(isChoose));+ INIManager.userTweaksServices.Remove(tweak);+ INIManager.userTweaksServices.Add(tweak, Convert.ToString(isChoose));switch (tweak){@@ -440,7 +440,7 @@ namespace GTweak.Utilities.Tweaksusing (BackgroundWorker backgroundWorker = new BackgroundWorker()){- backgroundWorker.DoWork += (s, e) => { StoreServices(isChoose); };+ backgroundWorker.DoWork += delegate { StoreServices(isChoose); };backgroundWorker.RunWorkerAsync();}break;diff --git a/.Source/GTweak/Utilities/Tweaks/SystemData.cs b/.Source/GTweak/Utilities/Tweaks/SystemData.csindex 291a813f..21de35db 100644--- a/.Source/GTweak/Utilities/Tweaks/SystemData.cs+++ b/.Source/GTweak/Utilities/Tweaks/SystemData.cs@@ -140,13 +140,13 @@ namespace GTweak.Utilitiesinternal void GetСonfigurationComputer(){- Parallel.Invoke(() =>+ Parallel.Invoke(delegate{foreach (var managementObj in new ManagementObjectSearcher(@"root\cimv2", "select Caption, OSArchitecture, Version from Win32_OperatingSystem", optionsObj).Get())СonfigurationData["Windows"] = $"{Convert.ToString(managementObj["Caption"]).Substring(Convert.ToString(managementObj["Caption"]).IndexOf('W'))}, {Regex.Replace((string)managementObj["OSArchitecture"], @"\-.+", "-bit")}, V{(string)managementObj["Version"]}\n";СonfigurationData["Windows"] = $"\n{СonfigurationData["Windows"].TrimEnd('\n')}";},- () =>+ delegate{foreach (var managementObj in new ManagementObjectSearcher(@"root\cimv2", "select Name, Caption, Description, SerialNumber from Win32_BIOS", optionsObj).Get()){@@ -158,26 +158,26 @@ namespace GTweak.UtilitiesСonfigurationData["BIOS"] += !string.IsNullOrEmpty((string)managementObj["SerialNumber"]) ? (string)managementObj["Description"] + ", S/N-" + (string)managementObj["SerialNumber"] + "\n" : (string)managementObj["Description"] + "\n";}СonfigurationData["BIOS"] = СonfigurationData["BIOS"].TrimEnd('\n');- },- () =>+ },+ delegate{foreach (var managementObj in new ManagementObjectSearcher(@"root\cimv2", "select Manufacturer, Product, Version from Win32_BaseBoard", optionsObj).Get())СonfigurationData["MotherBr"] = (string)managementObj["Manufacturer"] + (string)managementObj["Product"] + ", V" + (string)managementObj["Version"] + "\n";СonfigurationData["MotherBr"] = СonfigurationData["MotherBr"].TrimEnd('\n');},- () =>+ delegate{foreach (var managementObj in new ManagementObjectSearcher(@"root\cimv2", "select Name from Win32_Processor", optionsObj).Get())СonfigurationData["CPU"] = (string)managementObj["Name"] + "\n";СonfigurationData["CPU"] = СonfigurationData["CPU"].TrimEnd('\n');},- () =>+ delegate{foreach (var managementObj in new ManagementObjectSearcher(@"root\cimv2", "select Name, AdapterRAM from Win32_VideoController", optionsObj).Get())СonfigurationData["GPU"] += ((string)managementObj["Name"] + ", " + Convert.ToString(((uint)managementObj["AdapterRAM"] / 1024000000)) + " GB\n");СonfigurationData["GPU"] = СonfigurationData["GPU"].TrimEnd('\n');- },- () =>+ },+ delegate{foreach (var managementObj in new ManagementObjectSearcher(@"root\cimv2", "select Manufacturer, Capacity, ConfiguredClockSpeed from Win32_PhysicalMemory", optionsObj).Get())СonfigurationData["RAM"] += (string)managementObj["Manufacturer"] + ", " + Convert.ToString((ulong)managementObj["Capacity"] / 1024000000) + " GB, " + Convert.ToString((uint)managementObj["ConfiguredClockSpeed"]) + "MHz\n";@@ -189,8 +189,7 @@ namespace GTweak.Utilitiesinternal static void UpdatingDeviceData(){- Parallel.Invoke(- () =>+ Parallel.Invoke(delegate{СonfigurationData["Disk"] = string.Empty;foreach (var managementObj in new ManagementObjectSearcher(@"\\.\root\microsoft\windows\storage", "select FriendlyName,MediaType,Size,BusType from MSFT_PhysicalDisk", optionsObj).Get())@@ -206,9 +205,9 @@ namespace GTweak.UtilitiesСonfigurationData["Disk"] += Convert.ToString((ulong)managementObj["Size"] / 1024000000) + " GB " + "[" + (string)managementObj["FriendlyName"] + "] " + _type + "\n";}СonfigurationData["Disk"] = СonfigurationData["Disk"].TrimEnd('\n');- },- () =>- {+ },+ delegate+ {СonfigurationData["Sound"] = string.Empty;foreach (var managementObj in new ManagementObjectSearcher(@"root\cimv2", "select Name,Caption,Description from Win32_SoundDevice", optionsObj).Get()){@@ -221,7 +220,7 @@ namespace GTweak.Utilities}СonfigurationData["Sound"] = СonfigurationData["Sound"].TrimEnd('\n');},- () =>+ delegate{СonfigurationData["NetAdapter"] = string.Empty;foreach (var managementObj in new ManagementObjectSearcher(@"root\cimv2", "select Name from Win32_NetworkAdapter where NetConnectionStatus=2 or NetConnectionStatus=7", optionsObj).Get())diff --git a/.Source/GTweak/Utilities/Tweaks/SystemTweaks.cs b/.Source/GTweak/Utilities/Tweaks/SystemTweaks.csindex ab0bf471..43b6350d 100644--- a/.Source/GTweak/Utilities/Tweaks/SystemTweaks.cs+++ b/.Source/GTweak/Utilities/Tweaks/SystemTweaks.cs@@ -342,8 +342,8 @@ namespace GTweak.Utilities.Tweaksprivate static extern bool SystemParametersInfo(uint _uiAction, uint _uiParam, uint[] _pvParam, uint _fWinIni);internal static void UseSystem(string tweak, bool isChoose){- INIManager.configSystem.Remove(tweak);- INIManager.configSystem.Add(tweak, Convert.ToString(isChoose));+ INIManager.userTweaksSystem.Remove(tweak);+ INIManager.userTweaksSystem.Add(tweak, Convert.ToString(isChoose));switch (tweak){@@ -442,14 +442,14 @@ namespace GTweak.Utilities.Tweaksbreak;case "TglButton8":BackgroundWorker backgroundWorker = new BackgroundWorker();- backgroundWorker.DoWork += (s, e) =>+ backgroundWorker.DoWork += delegate{if (isChoose)new WindowsDefender().Disable();elsenew WindowsDefender().Enable();};- backgroundWorker.RunWorkerCompleted += (s, e) => { isTweakWorkingAntivirus = false; new ViewNotification().Show("restart"); };+ backgroundWorker.RunWorkerCompleted += delegate { isTweakWorkingAntivirus = false; new ViewNotification().Show("restart"); };backgroundWorker.RunWorkerAsync();BlockWDefender(isChoose);break;diff --git a/.Source/GTweak/Utilities/Tweaks/UninstallingApps.cs b/.Source/GTweak/Utilities/Tweaks/UninstallingApps.csindex 4a6076fd..837399c2 100644--- a/.Source/GTweak/Utilities/Tweaks/UninstallingApps.cs+++ b/.Source/GTweak/Utilities/Tweaks/UninstallingApps.cs@@ -164,10 +164,10 @@ namespace GTweak.Utilities.Tweaksswitch (appName){case "Widgets":- WidgetsTweak(true);+ WidgetsTweak();break;case "Cortana":- CortanaTweak(true);+ CortanaTweak();break;}}@@ -178,7 +178,7 @@ namespace GTweak.Utilities.Tweakscatch (Exception ex) { Debug.WriteLine(ex.Message.ToString()); }}- internal static void DeletedApp_All()+ internal static void DeletedAllApps(){try{@@ -213,54 +213,28 @@ namespace GTweak.Utilities.Tweaksprocess.Dispose();}- WidgetsTweak(true);- CortanaTweak(true);+ WidgetsTweak();+ CortanaTweak();DeletedOneDrive();}catch (Exception ex) { Debug.WriteLine(ex.Message.ToString()); }}+ private static void WidgetsTweak() => RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Dsh", "AllowNewsAndInterests", 0, RegistryValueKind.DWord);-- private static void WidgetsTweak(in bool isChoose)- {- if (isChoose)- RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Dsh", "AllowNewsAndInterests", 0, RegistryValueKind.DWord);- else- RegistryHelp.DeleteValue(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Dsh", "AllowNewsAndInterests");- }-- private static void CortanaTweak(in bool isChoose)+ private static void CortanaTweak(){- if (isChoose)- {- RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Microsoft\Speech_OneCore\Preferences", "ModelDownloadAllowed", 0, RegistryValueKind.DWord);- RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows\Windows Search", "AllowCloudSearch", 0, RegistryValueKind.DWord);- RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows\Windows Search", "AllowCortana", 0, RegistryValueKind.DWord);- RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows\Windows Search", "AllowSearchToUseLocation", 0, RegistryValueKind.DWord);- RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows\Windows Search", "ConnectedSearchUseWeb", 0, RegistryValueKind.DWord);- RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows\Windows Search", "DisableWebSearch", 1, RegistryValueKind.DWord);- RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows\Windows Search", "AllowNewsAndInterests", 0, RegistryValueKind.DWord);- RegistryHelp.Write(Registry.CurrentUser, @"Software\Microsoft\InputPersonalization", "RestrictImplicitInkCollection", 1, RegistryValueKind.DWord);- RegistryHelp.Write(Registry.CurrentUser, @"Software\Microsoft\InputPersonalization", "RestrictImplicitTextCollection", 1, RegistryValueKind.DWord);- RegistryHelp.Write(Registry.CurrentUser, @"Software\Microsoft\InputPersonalization\TrainedDataStore", "HarvestContacts", 0, RegistryValueKind.DWord);- RegistryHelp.Write(Registry.CurrentUser, @"Software\Microsoft\Personalization\Settings", "AcceptedPrivacyPolicy", 0, RegistryValueKind.DWord);- RegistryHelp.Write(Registry.CurrentUser, @"Software\Microsoft\Windows\CurrentVersion\Windows Search", "CortanaConsent", 0, RegistryValueKind.DWord);- }- else- {- RegistryHelp.DeleteValue(Registry.LocalMachine, @"SOFTWARE\Microsoft\Speech_OneCore\Preferences", "ModelDownloadAllowed");- RegistryHelp.DeleteValue(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows\Windows Search", "AllowCloudSearch");- RegistryHelp.DeleteValue(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows\Windows Search", "AllowCortana");- RegistryHelp.DeleteValue(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows\Windows Search", "AllowSearchToUseLocation");- RegistryHelp.DeleteValue(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows\Windows Search", "ConnectedSearchUseWeb");- RegistryHelp.DeleteValue(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows\Windows Search", "DisableWebSearch");- RegistryHelp.DeleteValue(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows\Windows Search", "AllowNewsAndInterests");- RegistryHelp.DeleteValue(Registry.CurrentUser, @"Software\Microsoft\InputPersonalization", "RestrictImplicitInkCollection");- RegistryHelp.DeleteValue(Registry.CurrentUser, @"Software\Microsoft\InputPersonalization", "RestrictImplicitTextCollection");- RegistryHelp.DeleteValue(Registry.CurrentUser, @"Software\Microsoft\InputPersonalization\TrainedDataStore", "HarvestContacts");- RegistryHelp.DeleteValue(Registry.CurrentUser, @"Software\Microsoft\Personalization\Settings", "AcceptedPrivacyPolicy");- RegistryHelp.DeleteValue(Registry.CurrentUser, @"Software\Microsoft\Windows\CurrentVersion\Windows Search", "CortanaConsent");- }+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Microsoft\Speech_OneCore\Preferences", "ModelDownloadAllowed", 0, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows\Windows Search", "AllowCloudSearch", 0, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows\Windows Search", "AllowCortana", 0, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows\Windows Search", "AllowSearchToUseLocation", 0, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows\Windows Search", "ConnectedSearchUseWeb", 0, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows\Windows Search", "DisableWebSearch", 1, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows\Windows Search", "AllowNewsAndInterests", 0, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.CurrentUser, @"Software\Microsoft\InputPersonalization", "RestrictImplicitInkCollection", 1, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.CurrentUser, @"Software\Microsoft\InputPersonalization", "RestrictImplicitTextCollection", 1, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.CurrentUser, @"Software\Microsoft\InputPersonalization\TrainedDataStore", "HarvestContacts", 0, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.CurrentUser, @"Software\Microsoft\Personalization\Settings", "AcceptedPrivacyPolicy", 0, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.CurrentUser, @"Software\Microsoft\Windows\CurrentVersion\Windows Search", "CortanaConsent", 0, RegistryValueKind.DWord);}internal static void DeletedOneDrive()diff --git a/.Source/GTweak/View/ApplicationsView.xaml.cs b/.Source/GTweak/View/ApplicationsView.xaml.csindex 3837d239..175b9185 100644--- a/.Source/GTweak/View/ApplicationsView.xaml.cs+++ b/.Source/GTweak/View/ApplicationsView.xaml.cs@@ -22,7 +22,7 @@ namespace GTweak.View{InitializeComponent();- App.LanguageChanged += (s, e) => { WorkWithText.TypeWriteAnimation((string)FindResource("defaultDescriptionApp"), TextDescription, TimeSpan.FromMilliseconds(0)); };+ App.LanguageChanged += delegate { WorkWithText.TypeWriteAnimation((string)FindResource("defaultDescriptionApp"), TextDescription, TimeSpan.FromMilliseconds(0)); };DispatcherTimer timer = new DispatcherTimer(new TimeSpan(0, 0, 1), DispatcherPriority.Normal, delegate{@@ -31,7 +31,7 @@ namespace GTweak.Viewelse if (time.TotalSeconds % 5 == 0){BackgroundWorker backgroundWorker = new BackgroundWorker();- backgroundWorker.DoWork += (s, e) => { new UninstallingApps().ViewInstalledApp(); };+ backgroundWorker.DoWork += delegate { new UninstallingApps().ViewInstalledApp(); };backgroundWorker.RunWorkerAsync();}@@ -49,7 +49,7 @@ namespace GTweak.ViewappImage.Source = (DrawingImage)FindResource("DI_Sandtime");BackgroundWorker backgroundWorker = new BackgroundWorker();- backgroundWorker.DoWork += (s, _) =>+ backgroundWorker.DoWork += delegate{if (applicationName != "YandexMusic"){@@ -62,7 +62,7 @@ namespace GTweak.ViewUninstallingApps.DeletedApp("Yandex.Music");}};- backgroundWorker.RunWorkerCompleted += async (s, _) =>+ backgroundWorker.RunWorkerCompleted += async delegate{await Task.Delay(25000);if (applicationName != "YandexMusic")@@ -81,8 +81,8 @@ namespace GTweak.Viewnew ViewNotification().Show("", (string)FindResource("title1_notification"), (string)FindResource("onedrive_notification"));BackgroundWorker backgroundWorker = new BackgroundWorker();- backgroundWorker.DoWork += (s, _) => UninstallingApps.ResetOneDrive();- backgroundWorker.RunWorkerCompleted += async (s, _) =>+ backgroundWorker.DoWork += delegate { UninstallingApps.ResetOneDrive(); };+ backgroundWorker.RunWorkerCompleted += async delegate{await Task.Delay(15000);UninstallingApps.isAppDeletedList[appImage.Name] = false;@@ -107,9 +107,9 @@ namespace GTweak.ViewbackgroundWorker.DoWork += (s, _) =>{new ViewNotification().Show("", (string)FindResource("title1_notification"), (string)FindResource("appsdelete_notification"));- Parallel.Invoke(UninstallingApps.DeletedApp_All);+ Parallel.Invoke(UninstallingApps.DeletedAllApps);};- backgroundWorker.RunWorkerCompleted += async (s, _) =>+ backgroundWorker.RunWorkerCompleted += async delegate{await Task.Delay(60000);foreach (string key in UninstallingApps.isAppDeletedList.Keys.ToList())diff --git a/.Source/GTweak/View/ConfidentialityView.xaml.cs b/.Source/GTweak/View/ConfidentialityView.xaml.csindex e6287c3c..4985d8a8 100644--- a/.Source/GTweak/View/ConfidentialityView.xaml.cs+++ b/.Source/GTweak/View/ConfidentialityView.xaml.cs@@ -16,7 +16,7 @@ namespace GTweak.View{InitializeComponent();- App.LanguageChanged += (s, e) => { WorkWithText.TypeWriteAnimation((string)FindResource("defaultDescription"), TextDescription, TimeSpan.FromMilliseconds(0)); };+ App.LanguageChanged += delegate { WorkWithText.TypeWriteAnimation((string)FindResource("defaultDescription"), TextDescription, TimeSpan.FromMilliseconds(0)); };}private void Tweak_MouseEnter(object sender, MouseEventArgs e)@@ -57,7 +57,7 @@ namespace GTweak.Viewprivate void Page_Loaded(object sender, RoutedEventArgs e){WorkWithText.TypeWriteAnimation((string)FindResource("defaultDescription"), TextDescription, TimeSpan.FromMilliseconds(300));- Parallel.Invoke(()=> new ConfidentialityTweaks().ViewСonfidentiality(this));+ Parallel.Invoke(() => new ConfidentialityTweaks().ViewСonfidentiality(this));}}}diff --git a/.Source/GTweak/View/InterfaceView.xaml.cs b/.Source/GTweak/View/InterfaceView.xaml.csindex 3f01d78a..818ac976 100644--- a/.Source/GTweak/View/InterfaceView.xaml.cs+++ b/.Source/GTweak/View/InterfaceView.xaml.cs@@ -17,7 +17,7 @@ namespace GTweak.View{InitializeComponent();- App.LanguageChanged += (s, e) => { WorkWithText.TypeWriteAnimation((string)FindResource("defaultDescription"), TextDescription, TimeSpan.FromMilliseconds(0)); };+ App.LanguageChanged += delegate { WorkWithText.TypeWriteAnimation((string)FindResource("defaultDescription"), TextDescription, TimeSpan.FromMilliseconds(0)); };if (WindowsLicense.statusLicense != 1){diff --git a/.Source/GTweak/View/MoreView.xaml.cs b/.Source/GTweak/View/MoreView.xaml.csindex 90442748..77b6232b 100644--- a/.Source/GTweak/View/MoreView.xaml.cs+++ b/.Source/GTweak/View/MoreView.xaml.cs@@ -27,13 +27,13 @@ namespace GTweak.Viewawait Task.Delay(100);BackgroundWorker backgroundWorker = new BackgroundWorker();- backgroundWorker.DoWork += (_s, _e) =>+ backgroundWorker.DoWork += delegate{try { RecoveryPoint.Create((string)FindResource("textpoint_more")); }catch { new ViewNotification().Show("", (string)FindResource("title0_notification"), (string)FindResource("notsuccessfulpoint_notification")); }finally { new ViewNotification().Show("", (string)FindResource("title1_notification"), (string)FindResource("successpoint_notification")); };};- backgroundWorker.RunWorkerCompleted += (_s, _e) =>+ backgroundWorker.RunWorkerCompleted += delegate{new ViewNotification().Show("", (string)FindResource("title1_notification"), (string)FindResource("successpoint_notification"));backgroundWorker.Dispose();@@ -80,11 +80,11 @@ namespace GTweak.Viewif (!RecoveryPoint.IsSystemRestoreDisabled()){BackgroundWorker backgroundWorker = new BackgroundWorker();- backgroundWorker.DoWork += (_s, _e) =>+ backgroundWorker.DoWork += delegate{try { RecoveryPoint.DisablePoint(); } catch (Exception ex) { Debug.WriteLine(ex.Message.ToString()); }};- backgroundWorker.RunWorkerCompleted += (_s, _e) =>+ backgroundWorker.RunWorkerCompleted += delegate{new ViewNotification().Show("", (string)FindResource("title1_notification"), (string)FindResource("disable_recovery_notification"));backgroundWorker.Dispose();diff --git a/.Source/GTweak/View/ServicesView.xaml.cs b/.Source/GTweak/View/ServicesView.xaml.csindex 4d703121..3a8d297d 100644--- a/.Source/GTweak/View/ServicesView.xaml.cs+++ b/.Source/GTweak/View/ServicesView.xaml.cs@@ -15,7 +15,7 @@ namespace GTweak.View{InitializeComponent();- App.LanguageChanged += (s, e) => { WorkWithText.TypeWriteAnimation((string)FindResource("defaultDescription"), TextDescription, TimeSpan.FromMilliseconds(0)); };+ App.LanguageChanged += delegate { WorkWithText.TypeWriteAnimation((string)FindResource("defaultDescription"), TextDescription, TimeSpan.FromMilliseconds(0)); };}private void Tweak_MouseEnter(object sender, MouseEventArgs e)diff --git a/.Source/GTweak/View/SystemView.xaml.cs b/.Source/GTweak/View/SystemView.xaml.csindex 370fae4e..96bb79b2 100644--- a/.Source/GTweak/View/SystemView.xaml.cs+++ b/.Source/GTweak/View/SystemView.xaml.cs@@ -16,7 +16,7 @@ namespace GTweak.View{InitializeComponent();- App.LanguageChanged += (s, e) => { WorkWithText.TypeWriteAnimation((string)FindResource("defaultDescription"), TextDescription, TimeSpan.FromMilliseconds(0)); };+ App.LanguageChanged += delegate { WorkWithText.TypeWriteAnimation((string)FindResource("defaultDescription"), TextDescription, TimeSpan.FromMilliseconds(0)); };}private void Tweak_MouseEnter(object sender, MouseEventArgs e)@@ -52,8 +52,8 @@ namespace GTweak.Viewprivate void Sliders_PreviewMouseUp(object sender, MouseButtonEventArgs e){Slider slider = (Slider)sender;- INIManager.configSystem.Remove(slider.Name);- INIManager.configSystem.Add(slider.Name, Convert.ToString(slider.Value));+ INIManager.userTweaksSystem.Remove(slider.Name);+ INIManager.userTweaksSystem.Add(slider.Name, Convert.ToString(slider.Value));}private void Sliders_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)@@ -94,8 +94,8 @@ namespace GTweak.Viewif (!SystemTweaks.isTweakWorkingAntivirus){SystemTweaks.isTweakWorkingAntivirus = true;- INIManager.configSystem.Remove(toggleButton.Name);- INIManager.configSystem.Add(toggleButton.Name, Convert.ToString(toggleButton.State));+ INIManager.userTweaksSystem.Remove(toggleButton.Name);+ INIManager.userTweaksSystem.Add(toggleButton.Name, Convert.ToString(toggleButton.State));SystemTweaks.UseSystem(toggleButton.Name, toggleButton.State);new ViewNotification().Show("", (string)FindResource("title1_notification"), (string)FindResource("windefender_notification"));}diff --git a/.Source/GTweak/Windows/LoadingWindow.xaml.cs b/.Source/GTweak/Windows/LoadingWindow.xaml.csindex a813b740..19f222cf 100644--- a/.Source/GTweak/Windows/LoadingWindow.xaml.cs+++ b/.Source/GTweak/Windows/LoadingWindow.xaml.cs@@ -27,7 +27,7 @@ namespace GTweak.WindowsbackgroundWorker.WorkerReportsProgress = true;backgroundWorker.DoWork += BackgroundWorker_DoWorkAsync;backgroundWorker.ProgressChanged += BackgroundWorker_ProgressChanged;- backgroundWorker.RunWorkerCompleted += async (s, _) =>+ backgroundWorker.RunWorkerCompleted += async delegate{backgroundWorker.Dispose();WorkWithText.TypeWriteAnimation((string)FindResource("text6_load"), TextLoad, TimeSpan.FromMilliseconds(300));@@ -47,7 +47,7 @@ namespace GTweak.Windows}Parallel.Invoke(- () => { Settings.PID = TrustedInstaller.StartTrustedInstallerService(); },+ delegate { Settings.PID = TrustedInstaller.StartTrustedInstallerService(); },new Settings().RunAnalysis,new WindowsLicense().LicenseStatus,new SystemData.СomputerСonfiguration().GetСonfigurationComputer,