예제 #1
0
        private static void AppInitialized(Application app, ProcessArguments args)
        {
            var splash = ShowSplash(args.SplashPath);
            var duplex = PlatformCommon.CreateClientDuplex(args.ParentProcessId, () => new BrowserHost());
            var form   = new MainForm(duplex, splash);

            form.Show();
            SettingsApplier.CenterForm(form);
            form.Visible     = false;
            BrowserHost.Form = form;
            form.Closed     += (sender, eventArgs) => app.Quit();
        }
예제 #2
0
        private static SplashForm ShowSplash(string path)
        {
            if (string.IsNullOrEmpty(path))
            {
                return(null);
            }
            var splash = new SplashForm(path);

            splash.Show();
            SettingsApplier.CenterForm(splash);
            splash.BringToFront();
            return(splash);
        }
예제 #3
0
        public MainForm(IpcPipeDuplex <IBrowserWindow, IBrowserHost> duplex, SplashForm splash)
        {
            _duplex  = duplex;
            _splash  = splash;
            Visible  = false;
            _painter = new SettingsApplier(this);
            var startup = _duplex.Client.Order(x => x.GetStartupOptions());

            ApplySettings(startup.Options);
            var browser = new WebView
            {
                Url = new Uri(startup.Url.AbsoluteUri)
            };

            browser.DocumentLoaded += Browser_LoadingStateChanged;
            Content = browser;
            Closed += MainForm_FormClosed;
            _duplex.RunBackground();
        }