Ejemplo n.º 1
0
        private void InitializeFieldsAndCefIfRequired()
        {
            if (!initialized)
            {
                if (!Cef.IsInitialized && !Cef.Initialize(new CefSettings()))
                {
                    throw new InvalidOperationException("Cef::Initialize() failed");
                }

                Cef.AddDisposable(this);

                if (FocusHandler == null)
                {
                    //If the WinForms UI thread and the CEF UI thread are one in the same
                    //then we don't need the FocusHandler, it's only required when using
                    //MultiThreadedMessageLoop (the default)
                    if (!Cef.CurrentlyOnThread(CefThreadIds.TID_UI))
                    {
                        FocusHandler = new DefaultFocusHandler();
                    }
                }

                if (browserSettings == null)
                {
                    browserSettings = new BrowserSettings(frameworkCreated: true);
                }

                managedCefBrowserAdapter = new ManagedCefBrowserAdapter(this, false);

                initialized = true;
            }
        }
Ejemplo n.º 2
0
        private void InitializeFieldsAndCefIfRequired()
        {
            if (!initialized)
            {
                if (!Cef.IsInitialized && !Cef.Initialize(new CefSettings()))
                {
                    throw new InvalidOperationException("Cef::Initialize() failed");
                }

                Cef.AddDisposable(this);

                if (FocusHandler == null)
                {
                    FocusHandler = new DefaultFocusHandler();
                }

                if (browserSettings == null)
                {
                    browserSettings = new BrowserSettings(frameworkCreated: true);
                }

                managedCefBrowserAdapter = new ManagedCefBrowserAdapter(this, false);

                initialized = true;
            }
        }
Ejemplo n.º 3
0
        private void InitializeFieldsAndCefIfRequired()
        {
            if (!initialized)
            {
                if (!Cef.IsInitialized && !Cef.Initialize())
                {
                    throw new InvalidOperationException("Cef::Initialize() failed");
                }

                Cef.AddDisposable(this);

                if (FocusHandler == null)
                {
                    FocusHandler = new DefaultFocusHandler(this);
                }

                if (ResourceHandlerFactory == null)
                {
                    ResourceHandlerFactory = new DefaultResourceHandlerFactory();
                }

                if (BrowserSettings == null)
                {
                    BrowserSettings = new BrowserSettings();
                }

                managedCefBrowserAdapter = new ManagedCefBrowserAdapter(this, false);

                initialized = true;
            }
        }
Ejemplo n.º 4
0
        public ChromiumWebBrowser(string address)
        {
            Cef.AddDisposable(this);
            Address = address;

            Dock = DockStyle.Fill;

            FocusHandler = new DefaultFocusHandler(this);
        }
Ejemplo n.º 5
0
        protected void Initialize()
        {
            Application.ApplicationExit += OnApplicationExit;
            Cef.AddDisposable(this);
            // Dock = DockStyle.Fill;

            FocusHandler    = new DefaultFocusHandler(this);
            ResourceHandler = new DefaultResourceHandler();

            managedCefBrowserAdapter = new ManagedCefBrowserAdapter(this);
        }
Ejemplo n.º 6
0
        public ChromiumWebBrowser(string address)
        {
            Cef.AddDisposable(this);
            Address = address;

            Dock = DockStyle.Fill;

            FocusHandler    = new DefaultFocusHandler(this);
            ResourceHandler = new DefaultResourceHandler();

            managedCefBrowserAdapter = new ManagedCefBrowserAdapter(this, false);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ChromiumWebBrowser"/> class.
        /// </summary>
        /// <param name="address">The address.</param>
        /// <exception cref="System.InvalidOperationException">Cef::Initialize() failed</exception>
        public ChromiumWebBrowser(string address)
        {
            if (!Cef.IsInitialized && !Cef.Initialize())
            {
                throw new InvalidOperationException("Cef::Initialize() failed");
            }

            Cef.AddDisposable(this);
            Address = address;

            Dock = DockStyle.Fill;

            FocusHandler           = new DefaultFocusHandler(this);
            ResourceHandlerFactory = new DefaultResourceHandlerFactory();
            BrowserSettings        = new BrowserSettings();

            managedCefBrowserAdapter = new ManagedCefBrowserAdapter(this, false);
        }
Ejemplo n.º 8
0
		protected void Initialize()
		{
			Application.ApplicationExit += OnApplicationExit;
			Cef.AddDisposable(this);
			// Dock = DockStyle.Fill;

			FocusHandler = new DefaultFocusHandler(this);
			ResourceHandler = new DefaultResourceHandler();

			managedCefBrowserAdapter = new ManagedCefBrowserAdapter(this);
		}