/// <summary>
        /// Initializes a new instance of the <see cref="Window"/> class.
        /// </summary>
        /// <param name="application">
        /// The application.
        /// </param>
        /// <param name="hostConfig">
        /// The host config.
        /// </param>
        public Window(HostBase application, ChromelyConfiguration hostConfig)
            : base(hostConfig.HostTitle, hostConfig.HostWidth, hostConfig.HostHeight, hostConfig.HostIconFile)
        {
            mHostConfig       = hostConfig;
            mBrowser          = new CefGlueBrowser(this, hostConfig, new CefBrowserSettings());
            mBrowser.Created += OnBrowserCreated;
            mApplication      = application;

            // Set event handler
            mBrowser.SetEventHandlers();

            ShowWindow();
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Window"/> class.
        /// </summary>
        /// <param name="application">
        /// The application.
        /// </param>
        /// <param name="hostConfig">
        /// The host config.
        /// </param>
        public Window(HostBase application, ChromelyConfiguration hostConfig)
            : base(hostConfig)
        {
            _hostConfig      = hostConfig;
            Browser          = new CefGlueBrowser(this, hostConfig, new CefBrowserSettings());
            Browser.Created += OnBrowserCreated;
            _application     = application;

            // Set event handler
            Browser.SetEventHandlers();

            ShowWindow();
        }
Exemple #3
0
        public Window(IChromelyNativeHost nativeHost, IChromelyContainer container, IChromelyConfiguration config, IChromelyCommandTaskRunner commandTaskRunner, CefMessageRouterBrowserSide browserMessageRouter)
            : base(nativeHost, config)
        {
            _container            = container;
            _config               = config;
            _commandTaskRunner    = commandTaskRunner;
            _browserMessageRouter = browserMessageRouter;
            Browser               = new CefGlueBrowser(this, _container, config, _commandTaskRunner, _browserMessageRouter, new CefBrowserSettings());
            Browser.Created      += OnBrowserCreated;

            // Set event handler
            Browser.SetEventHandlers(_container);

            ShowWindow();
        }
Exemple #4
0
        public Window(IChromelyNativeHost nativeHost, IChromelyContainer container, IChromelyConfiguration config, IChromelyCommandTaskRunner commandTaskRunner, CefMessageRouterBrowserSide browserMessageRouter)
            : base(nativeHost, config)
        {
            _container            = container;
            _config               = config;
            _commandTaskRunner    = commandTaskRunner;
            _browserMessageRouter = browserMessageRouter;
            Browser               = new CefGlueBrowser(this, _container, config, _commandTaskRunner, _browserMessageRouter, new CefBrowserSettings());

            // Set event handler
            Browser.SetEventHandlers(_container);

            Browser.Created += OnBrowserCreated;

            // 'Created' event sometimes tries to attach interceptors too early, while all windows is not created yet,
            // so it's better to use 'FrameLoadStart'.
            Browser.FrameLoadStart += OnFrameLoadStart;

            ShowWindow();
        }