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; } }
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; } }
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; } }
public ChromiumWebBrowser(string address) { Cef.AddDisposable(this); Address = address; Dock = DockStyle.Fill; FocusHandler = new DefaultFocusHandler(this); }
protected void Initialize() { Application.ApplicationExit += OnApplicationExit; Cef.AddDisposable(this); // Dock = DockStyle.Fill; FocusHandler = new DefaultFocusHandler(this); ResourceHandler = new DefaultResourceHandler(); managedCefBrowserAdapter = new ManagedCefBrowserAdapter(this); }
public ChromiumWebBrowser(string address) { Cef.AddDisposable(this); Address = address; Dock = DockStyle.Fill; FocusHandler = new DefaultFocusHandler(this); ResourceHandler = new DefaultResourceHandler(); managedCefBrowserAdapter = new ManagedCefBrowserAdapter(this, false); }
/// <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); }