Ejemplo n.º 1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            KanColleClient.Current.Proxy.Startup(AppSettings.Default.LocalProxyPort);
            Settings.Load();

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

            ViewModelRoot   = new MainWindowViewModel();
            this.MainWindow = new MainWindow {
                DataContext = ViewModelRoot
            };
            this.MainWindow.Show();
        }
Ejemplo n.º 2
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();
        }