Пример #1
0
        // silent config processing for Windows 10 tweaks
        internal static void ProcessSilentConfigWindows10()
        {
            if (CurrentSilentConfig.EnableLegacyVolumeSlider.HasValue)
            {
                if (CurrentSilentConfig.EnableLegacyVolumeSlider.Value)
                {
                    Optimize.EnableLegacyVolumeSlider();
                }
                else
                {
                    Optimize.DisableLegacyVolumeSlider();
                }
            }

            if (CurrentSilentConfig.EnableTaskbarColor.HasValue)
            {
                if (CurrentSilentConfig.EnableTaskbarColor.Value)
                {
                    Optimize.EnableTaskbarColor();
                }
                else
                {
                    Optimize.DisableTaskbarColor();
                }
            }

            if (CurrentSilentConfig.DisableQuickAccessHistory.HasValue)
            {
                if (CurrentSilentConfig.DisableQuickAccessHistory.Value)
                {
                    Optimize.DisableQuickAccessHistory();
                }
                else
                {
                    Optimize.EnableQuickAccessHistory();
                }
            }

            if (CurrentSilentConfig.DisableStartMenuAds.HasValue)
            {
                if (CurrentSilentConfig.DisableStartMenuAds.Value)
                {
                    Optimize.DisableStartMenuAds();
                }
                else
                {
                    Optimize.EnableStartMenuAds();
                }
            }

            if (CurrentSilentConfig.EnableDarkTheme.HasValue)
            {
                if (CurrentSilentConfig.EnableDarkTheme.Value)
                {
                    Optimize.EnableDarkTheme();
                }
                else
                {
                    Optimize.EnableLightTheme();
                }
            }

            if (CurrentSilentConfig.UninstallOneDrive.HasValue)
            {
                if (CurrentSilentConfig.UninstallOneDrive.Value)
                {
                    Task t = new Task(() => Optimize.UninstallOneDrive());
                    t.Start();
                }
                else
                {
                    Task t = new Task(() => Optimize.InstallOneDrive());
                    t.Start();
                }
            }

            if (CurrentSilentConfig.DisableMyPeople.HasValue)
            {
                if (CurrentSilentConfig.DisableMyPeople.Value)
                {
                    Optimize.DisableMyPeople();
                }
                else
                {
                    Optimize.EnableMyPeople();
                }
            }

            if (CurrentSilentConfig.EnableLongPaths.HasValue)
            {
                if (CurrentSilentConfig.EnableLongPaths.Value)
                {
                    Optimize.EnableLongPaths();
                }
                else
                {
                    Optimize.DisableLongPaths();
                }
            }

            if (CurrentSilentConfig.DisableAutomaticUpdates.HasValue)
            {
                if (CurrentSilentConfig.DisableAutomaticUpdates.Value)
                {
                    Optimize.DisableAutomaticUpdates();
                }
                else
                {
                    Optimize.EnableAutomaticUpdates();
                }
            }

            if (CurrentSilentConfig.ExcludeDrivers.HasValue)
            {
                if (CurrentSilentConfig.ExcludeDrivers.Value)
                {
                    Optimize.ExcludeDrivers();
                }
                else
                {
                    Optimize.IncludeDrivers();
                }
            }

            if (CurrentSilentConfig.DisableTelemetryServices.HasValue)
            {
                if (CurrentSilentConfig.DisableTelemetryServices.Value)
                {
                    Optimize.DisableTelemetryServices();
                }
                else
                {
                    Optimize.EnableTelemetryServices();
                }
            }

            if (CurrentSilentConfig.DisablePrivacyOptions.HasValue)
            {
                if (CurrentSilentConfig.DisablePrivacyOptions.Value)
                {
                    Optimize.DisablePrivacyOptions();
                }
                else
                {
                    Optimize.EnablePrivacyOptions();
                }
            }

            if (CurrentSilentConfig.DisableCortana.HasValue)
            {
                if (CurrentSilentConfig.DisableCortana.Value)
                {
                    Optimize.DisableCortana();
                }
                else
                {
                    Optimize.EnableCortana();
                }
            }

            if (CurrentSilentConfig.DisableSensorServices.HasValue)
            {
                if (CurrentSilentConfig.DisableSensorServices.Value)
                {
                    Optimize.DisableSensorServices();
                }
                else
                {
                    Optimize.EnableSensorServices();
                }
            }

            if (CurrentSilentConfig.DisableWindowsInk.HasValue)
            {
                if (CurrentSilentConfig.DisableWindowsInk.Value)
                {
                    Optimize.DisableWindowsInk();
                }
                else
                {
                    Optimize.EnableWindowsInk();
                }
            }

            if (CurrentSilentConfig.DisableSpellingTyping.HasValue)
            {
                if (CurrentSilentConfig.DisableSpellingTyping.Value)
                {
                    Optimize.DisableSpellingAndTypingFeatures();
                }
                else
                {
                    Optimize.EnableSpellingAndTypingFeatures();
                }
            }

            if (CurrentSilentConfig.DisableXboxLive.HasValue)
            {
                if (CurrentSilentConfig.DisableXboxLive.Value)
                {
                    Optimize.DisableXboxLive();
                }
                else
                {
                    Optimize.EnableXboxLive();
                }
            }

            if (CurrentSilentConfig.DisableGameBar.HasValue)
            {
                if (CurrentSilentConfig.DisableGameBar.Value)
                {
                    Optimize.DisableGameBar();
                }
                else
                {
                    Optimize.EnableGameBar();
                }
            }

            if (CurrentSilentConfig.DisableInsiderService.HasValue)
            {
                if (CurrentSilentConfig.DisableInsiderService.Value)
                {
                    Optimize.DisableInsiderService();
                }
                else
                {
                    Optimize.EnableInsiderService();
                }
            }

            if (CurrentSilentConfig.DisableFeatureUpdates.HasValue)
            {
                if (CurrentSilentConfig.DisableFeatureUpdates.Value)
                {
                    Optimize.DisableForcedFeatureUpdates();
                }
                else
                {
                    Optimize.EnableForcedFeatureUpdates();
                }
            }

            if (CurrentSilentConfig.DisableCloudClipboard.HasValue)
            {
                if (CurrentSilentConfig.DisableCloudClipboard.Value)
                {
                    Optimize.DisableCloudClipboard();
                }
                else
                {
                    Optimize.EnableCloudClipboard();
                }
            }

            if (CurrentSilentConfig.RemoveCastToDevice.HasValue)
            {
                if (CurrentSilentConfig.RemoveCastToDevice.Value)
                {
                    Optimize.RemoveCastToDevice();
                }
                else
                {
                    Optimize.AddCastToDevice();
                }
            }

            if (CurrentSilentConfig.DisableActionCenter.HasValue)
            {
                if (CurrentSilentConfig.DisableActionCenter.Value)
                {
                    Optimize.DisableActionCenter();
                }
                else
                {
                    Optimize.EnableActionCenter();
                }
            }
        }