Пример #1
0
        private void SkinsComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if ((!(isInitializing)) && (e.AddedItems.Count >= 0))
            {
                string skin = e.AddedItems[0] as string;

                SkinsManager.ChangeSkin(skin);

                AppSettings.Skin = skin;
                AppSettings.Save();
            }
        }
Пример #2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            DOMConfigurator.Configure();

            Logger.Info("Witty is starting.");

            CheckForCorruptedConfigFile();

            Properties.Settings appSettings = Witty.Properties.Settings.Default;
            if (appSettings.UpgradeSettings)
            {
                Witty.Properties.Settings.Default.Upgrade();
                appSettings.UpgradeSettings = false;
            }

            // Set the default proxy here once and for all (should then be used by
            // WPF controls, like images that fetch their source from the internet)
            if (appSettings.UseProxy)
            {
                HttpWebRequest.DefaultWebProxy = WebProxyHelper.GetConfiguredWebProxy();
            }


            if (!string.IsNullOrEmpty(appSettings.Skin))
            {
                try
                {
                    SkinsManager.ChangeSkin(appSettings.Skin);
                }
                catch
                {
                    Logger.Error("Selected skin " + appSettings.Skin + " + not found");
                    // REVIEW: Should witty do something smart here?
                }
            }

            base.OnStartup(e);
        }