Esempio n. 1
0
        private void InitializeWindow()
        {
            window                 = uiFactory.CreateBrowserWindow(control, settings, isMainInstance);
            window.Closing        += () => Terminated?.Invoke(Id);
            window.AddressChanged += Window_AddressChanged;
            window.BackwardNavigationRequested += Window_BackwardNavigationRequested;
            window.DeveloperConsoleRequested   += Window_DeveloperConsoleRequested;
            window.ForwardNavigationRequested  += Window_ForwardNavigationRequested;
            window.ReloadRequested             += ReloadRequested;
            window.ZoomInRequested             += ZoomInRequested;
            window.ZoomOutRequested            += ZoomOutRequested;
            window.ZoomResetRequested          += ZoomResetRequested;
            window.UpdateZoomLevel(CalculateZoomPercentage());
            window.Show();

            logger.Debug("Initialized browser window.");
        }
Esempio n. 2
0
        internal void Initialize()
        {
            var contextMenuHandler = new ContextMenuHandler();
            var displayHandler     = new DisplayHandler();
            var downloadLogger     = logger.CloneFor($"{nameof(DownloadHandler)} {Id}");
            var downloadHandler    = new DownloadHandler(appConfig, settings, downloadLogger);
            var keyboardHandler    = new KeyboardHandler();
            var lifeSpanHandler    = new LifeSpanHandler();
            var requestHandler     = new RequestHandler(appConfig);

            displayHandler.FaviconChanged  += DisplayHandler_FaviconChanged;
            displayHandler.ProgressChanged += DisplayHandler_ProgressChanged;
            downloadHandler.ConfigurationDownloadRequested += DownloadHandler_ConfigurationDownloadRequested;
            keyboardHandler.ReloadRequested    += ReloadRequested;
            keyboardHandler.ZoomInRequested    += ZoomInRequested;
            keyboardHandler.ZoomOutRequested   += ZoomOutRequested;
            keyboardHandler.ZoomResetRequested += ZoomResetRequested;
            lifeSpanHandler.PopupRequested     += LifeSpanHandler_PopupRequested;

            control = new BrowserControl(contextMenuHandler, displayHandler, downloadHandler, keyboardHandler, lifeSpanHandler, requestHandler, url);
            control.AddressChanged      += Control_AddressChanged;
            control.LoadingStateChanged += Control_LoadingStateChanged;
            control.TitleChanged        += Control_TitleChanged;
            control.Initialize();

            logger.Debug("Initialized browser control.");

            window                 = uiFactory.CreateBrowserWindow(control, settings, isMainInstance);
            window.Closing        += () => Terminated?.Invoke(Id);
            window.AddressChanged += Window_AddressChanged;
            window.BackwardNavigationRequested += Window_BackwardNavigationRequested;
            window.DeveloperConsoleRequested   += Window_DeveloperConsoleRequested;
            window.ForwardNavigationRequested  += Window_ForwardNavigationRequested;
            window.ReloadRequested             += ReloadRequested;
            window.ZoomInRequested             += ZoomInRequested;
            window.ZoomOutRequested            += ZoomOutRequested;
            window.ZoomResetRequested          += ZoomResetRequested;
            window.UpdateZoomLevel(CalculateZoomPercentage());

            logger.Debug("Initialized browser window.");
        }