示例#1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            this.DispatcherUnhandledException += (sender, args) => ReportException(sender, args.Exception);

            DispatcherHelper.UIDispatcher = this.Dispatcher;
            Helper.SetRegistryFeatureBrowserEmulation();
            KanColleClient.Current.Proxy.Startup(AppSettings.Default.LocalProxyPort);
            Settings.Load();

            ProductInfo = new ProductInfo();

            var proxy = KanColleClient.Current.Proxy;
            proxy.UpstreamProxyHost = Settings.Current.ProxyHost;
            proxy.UpstreamProxyPort = Settings.Current.ProxyPort;
            proxy.UseProxyOnConnect = Settings.Current.EnableProxy;
            proxy.UseProxyOnSSLConnect = Settings.Current.EnableSSLProxy;

            if (Toast.IsSupported)
            {
                Toast.TryInstallShortcut();
            }
            else
            {
                NotifyIconWrapper.Initialize();
            }

            ThemeService.Current.Initialize(this);

            ViewModelRoot = new MainWindowViewModel();
            this.MainWindow = new MainWindow { DataContext = ViewModelRoot };
            this.MainWindow.Show();
        }
示例#2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            DispatcherHelper.UIDispatcher = this.Dispatcher;
            KanColleClient.Current.Proxy.Startup(AppSettings.Default.LocalProxyPort);
            Settings.Load();

            ProductInfo = new ProductInfo();

            var proxy = KanColleClient.Current.Proxy;
            proxy.UpstreamProxyHost = Settings.Current.ProxyHost;
            proxy.UpstreamProxyPort = Settings.Current.ProxyPort;
            proxy.UseProxyOnConnect = Settings.Current.EnableProxy;
            proxy.UseProxyOnSSLConnect = Settings.Current.EnableSSLProxy;

            if (Toast.IsSupported)
            {
                Toast.TryInstallShortcut();
            }

            ThemeService.Current.Initialize(this);

            ViewModelRoot = new MainWindowViewModel();
            this.MainWindow = new MainWindow { DataContext = ViewModelRoot };
            this.MainWindow.Show();
        }