Beispiel #1
0
        void SaveSettings()
        {
            SetError();
            if (MaxChatHistory.Value == null)
            {
                MaxChatHistory.Value = 100;
            }
            var dataDirectory         = TextBoxDataDirectory.Text;
            var windowSkin            = TextBoxWindowSkin.Text;
            var tileWindowSkin        = CheckBoxTileWindowSkin.IsChecked ?? false;
            var useLightChat          = CheckBoxLightChat.IsChecked ?? false;
            var useHardwareRendering  = CheckBoxUseHardwareRendering.IsChecked ?? false;
            var useTransparentWindows = CheckBoxUseWindowTransparency.IsChecked ?? false;
            var ignoreSSLCertificates = CheckBoxIgnoreSSLCertificates.IsChecked ?? false;
            var maxChatHistory        = MaxChatHistory.Value ?? 100;
            var enableChatImages      = CheckBoxEnableChatImages.IsChecked ?? false;
            //var enableChatGifs = CheckBoxEnableChatGifs.IsChecked ?? false;
            var enableWhisperSound    = CheckBoxEnableWhisperSound.IsChecked ?? false;
            var enableNameSound       = CheckBoxEnableNameSound.IsChecked ?? false;
            var useWindowsForChat     = CheckBoxUseWindowsForChat.IsChecked ?? false;
            var chatFontSize          = ChatFontSize.Value ?? 12;
            var useInstantSearch      = CheckBoxUseInstantSearch.IsChecked ?? false;
            var enableGameSounds      = CheckBoxEnableGameSounds.IsChecked ?? false;
            var enableAdvancedOptions = CheckBoxEnableAdvancedOptions.IsChecked ?? false;
            var useGameFonts          = CheckBoxEnableGameFonts.IsChecked ?? false;
            var handDensity           = HandDensitySlider.Value;

            Prefs.ZoomType     zoomOption = (Prefs.ZoomType)ComboBoxZoomOptions.SelectedIndex;
            Prefs.CardAnimType animOption = (Prefs.CardAnimType)ComboBoxCardMoveNotification.SelectedIndex;
            var task = new Task(
                () =>
                this.SaveSettingsTask(
                    ref dataDirectory,
                    useLightChat,
                    useHardwareRendering,
                    useTransparentWindows,
                    ignoreSSLCertificates,
                    maxChatHistory,
                    enableChatImages,
                    enableWhisperSound,
                    enableNameSound,
                    windowSkin,
                    tileWindowSkin,
                    useWindowsForChat,
                    chatFontSize,
                    useInstantSearch,
                    enableGameSounds,
                    zoomOption, animOption, enableAdvancedOptions,
                    useGameFonts,
                    handDensity)
                );

            task.ContinueWith((t) =>
            {
                Dispatcher
                .Invoke(new Action(
                            () => this.SaveSettingsComplete(t)));
            });
            task.Start();
        }
Beispiel #2
0
        void SaveSettingsTask(
            ref string dataDirectory,
            bool useLightChat,
            bool useHardwareRendering,
            bool useTransparentWindows,
            bool ignoreSSLCertificates,
            int maxChatHistory,
            bool enableChatImages,
            bool enableWhisperSound,
            bool enableNameSound,
            string windowSkin,
            bool tileWindowSkin,
            bool useWindowsForChat,
            int chatFontSize,
            bool useInstantSearch,
            bool enableGameSounds,
            Prefs.ZoomType zoomOption)
        {
            this.ValidateFields(
                ref dataDirectory,
                useLightChat,
                useHardwareRendering,
                useTransparentWindows,
                ignoreSSLCertificates,
                maxChatHistory,
                enableChatImages,
                enableWhisperSound,
                enableNameSound,
                windowSkin,
                tileWindowSkin,
                useWindowsForChat,
                chatFontSize,
                useInstantSearch,
                enableGameSounds
                );

            Prefs.DataDirectory         = dataDirectory;
            Prefs.UseLightChat          = useLightChat;
            Prefs.UseHardwareRendering  = useHardwareRendering;
            Prefs.UseWindowTransparency = useTransparentWindows;
            Prefs.IgnoreSSLCertificates = ignoreSSLCertificates;
            Prefs.MaxChatHistory        = maxChatHistory;
            Prefs.EnableChatImages      = enableChatImages;
            Prefs.EnableWhisperSound    = enableWhisperSound;
            Prefs.EnableNameSound       = enableNameSound;
            Prefs.WindowSkin            = windowSkin;
            Prefs.TileWindowSkin        = tileWindowSkin;
            Prefs.UseWindowsForChat     = useWindowsForChat;
            Prefs.ChatFontSize          = chatFontSize;
            Prefs.InstantSearch         = useInstantSearch;
            Prefs.EnableGameSound       = enableGameSounds;
            Prefs.ZoomOption            = zoomOption;
            //Prefs.EnableChatGifs = enableChatGifs;
        }
Beispiel #3
0
        void SaveSettingsTask(
            ref string dataDirectory,
            bool useLightChat,
            bool useHardwareRendering,
            bool useTransparentWindows,
            bool ignoreSSLCertificates,
            int maxChatHistory,
            bool enableChatImages,
            bool enableWhisperSound,
            bool enableNameSound,
            string windowSkin,
            string windowBorderDecorator,
            bool tileWindowSkin,
            bool useWindowsForChat,
            int chatFontSize,
            bool useInstantSearch,
            bool enableGameSounds,
            Prefs.ZoomType zoomOption,
            Prefs.SoundType soundOption,
            Prefs.CardAnimType animOption,
            bool enableAdvancedOptions,
            bool useGameFonts,
            double handDensity,
            bool useTestReleases)
        {
            this.ValidateFields(
                ref dataDirectory,
                useLightChat,
                useHardwareRendering,
                useTransparentWindows,
                ignoreSSLCertificates,
                maxChatHistory,
                enableChatImages,
                enableWhisperSound,
                enableNameSound,
                windowSkin,
                tileWindowSkin,
                useWindowsForChat,
                chatFontSize,
                useInstantSearch,
                enableGameSounds,
                enableAdvancedOptions,
                useGameFonts,
                handDensity,
                useTestReleases
                );

            Prefs.DataDirectory         = dataDirectory;
            Prefs.UseLightChat          = useLightChat;
            Prefs.UseHardwareRendering  = useHardwareRendering;
            Prefs.UseWindowTransparency = useTransparentWindows;
            Prefs.IgnoreSSLCertificates = ignoreSSLCertificates;
            Prefs.MaxChatHistory        = maxChatHistory;
            Prefs.EnableChatImages      = enableChatImages;
            Prefs.EnableWhisperSound    = enableWhisperSound;
            Prefs.EnableNameSound       = enableNameSound;
            Prefs.WindowSkin            = windowSkin;
            Prefs.WindowBorderDecorator = windowBorderDecorator;
            Prefs.TileWindowSkin        = tileWindowSkin;
            Prefs.UseWindowsForChat     = useWindowsForChat;
            Prefs.ChatFontSize          = chatFontSize;
            Prefs.InstantSearch         = useInstantSearch;
            Prefs.EnableGameSound       = enableGameSounds;
            Prefs.SoundOption           = soundOption;
            Prefs.ZoomOption            = zoomOption;
            Prefs.CardMoveNotification  = animOption;
            Prefs.EnableAdvancedOptions = enableAdvancedOptions;
            Prefs.UseGameFonts          = useGameFonts;
            Prefs.HandDensity           = handDensity;
            if (useTestReleases && !File.Exists(Path.Combine(Config.Instance.Paths.ConfigDirectory, "TEST")))
            {
                File.Create(Path.Combine(Config.Instance.Paths.ConfigDirectory, "TEST"));
            }
            else if (!useTestReleases && File.Exists(Path.Combine(Config.Instance.Paths.ConfigDirectory, "TEST")))
            {
                File.Delete(Path.Combine(Config.Instance.Paths.ConfigDirectory, "TEST"));
            }
            //Prefs.EnableChatGifs = enableChatGifs;
        }