Inheritance: IModernWebBrowserWindow
Exemplo n.º 1
0
        public ChromiumFxWpfWindow(IWebSessionLogger logger)
        {
            var logger1 = logger;

            _ChromiumFxControl = new ChromiumFxControl()
            {
                Visibility          = Visibility.Hidden,
                VerticalAlignment   = VerticalAlignment.Stretch,
                HorizontalAlignment = HorizontalAlignment.Stretch,
                ContextMenu         = new ContextMenu()
                {
                    Visibility = Visibility.Collapsed
                }
            };
            _ChromiumWebBrowser = _ChromiumFxControl.ChromiumWebBrowser;

            //add request interception to handler pack uri request
            _ChromiumWebBrowser.RequestHandler.GetResourceHandler += (s, e) =>
            {
                var uri = new Uri(e.Request.Url);
                if (uri.Scheme != "pack")
                {
                    return;
                }

                var newResourceHandler = new PackUriResourceHandler(uri, logger1);
                _PackPackUriResourceHandlers.Add(newResourceHandler);
                e.SetReturnValue(newResourceHandler);
            };

            var dispatcher = new WPFUIDispatcher(_ChromiumFxControl.Dispatcher);

            _ChromiumFxControlWebBrowserWindow = new ChromiumFxControlWebBrowserWindow(_ChromiumWebBrowser, dispatcher, logger1);
        }
 public ChromiumFxWpfWindow(IWebSessionLogger logger) 
 {
     _Logger = logger;
     _ChromiumFxControl = new ChromiumFxControl()
     {
         Visibility = Visibility.Hidden,
         VerticalAlignment = VerticalAlignment.Stretch,
         HorizontalAlignment = HorizontalAlignment.Stretch,
         ContextMenu = new ContextMenu() { Visibility = Visibility.Collapsed }
     };
     _ChromiumWebBrowser = _ChromiumFxControl.ChromiumWebBrowser;
     var dispatcher = new WPFUIDispatcher(_ChromiumFxControl.Dispatcher);
     _chromiumFxControlWebBrowserWindow = new ChromiumFxControlWebBrowserWindow(_ChromiumWebBrowser, dispatcher, _Logger);
 }
Exemplo n.º 3
0
        public ChromiumFxWpfWindow(IWebSessionLogger logger)
        {
            _Logger            = logger;
            _ChromiumFxControl = new ChromiumFxControl()
            {
                Visibility          = Visibility.Hidden,
                VerticalAlignment   = VerticalAlignment.Stretch,
                HorizontalAlignment = HorizontalAlignment.Stretch,
                ContextMenu         = new ContextMenu()
                {
                    Visibility = Visibility.Collapsed
                }
            };
            _ChromiumWebBrowser = _ChromiumFxControl.ChromiumWebBrowser;
            var dispatcher = new WPFUIDispatcher(_ChromiumFxControl.Dispatcher);

            _chromiumFxControlWebBrowserWindow = new ChromiumFxControlWebBrowserWindow(_ChromiumWebBrowser, dispatcher, _Logger);
        }
Exemplo n.º 4
0
        public ChromiumFxWpfWindow(IWebSessionLogger logger, bool useNeutroniumSettings)
        {
            _Logger            = logger;
            _ChromiumFxControl = new ChromiumFxControl(useNeutroniumSettings)
            {
                Visibility          = Visibility.Hidden,
                VerticalAlignment   = VerticalAlignment.Stretch,
                HorizontalAlignment = HorizontalAlignment.Stretch,
                ContextMenu         = new ContextMenu()
                {
                    Visibility = Visibility.Collapsed
                }
            };
            _ChromiumWebBrowser = _ChromiumFxControl.ChromiumWebBrowser;
            _ChromiumWebBrowser.LoadHandler.OnLoadEnd += LoadHandler_OnLoadEnd;
            var dispatcher = new WPFUIDispatcher(_ChromiumFxControl.Dispatcher);

            _ChromiumFxControlWebBrowserWindow = new ChromiumFxControlWebBrowserWindow(_ChromiumWebBrowser, dispatcher, logger);
        }