mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-05 11:42:36 +00:00
Add Cef.Initialize check in constructor of WinForms and OffScreen implementations - makes them consistent with the WPF version.
This commit is contained in:
@@ -44,6 +44,11 @@ namespace CefSharp.OffScreen
|
||||
/// <param name="browserSettings">The browser settings to use. If null, the default settings are used.</param>
|
||||
public ChromiumWebBrowser(string address, BrowserSettings browserSettings = null)
|
||||
{
|
||||
if (!Cef.IsInitialized && !Cef.Initialize())
|
||||
{
|
||||
throw new InvalidOperationException("Cef::Initialize() failed");
|
||||
}
|
||||
|
||||
ResourceHandler = new DefaultResourceHandler();
|
||||
|
||||
Cef.AddDisposable(this);
|
||||
|
||||
@@ -56,6 +56,11 @@ namespace CefSharp.WinForms
|
||||
|
||||
public ChromiumWebBrowser(string address)
|
||||
{
|
||||
if (!Cef.IsInitialized && !Cef.Initialize())
|
||||
{
|
||||
throw new InvalidOperationException("Cef::Initialize() failed");
|
||||
}
|
||||
|
||||
Cef.AddDisposable(this);
|
||||
Address = address;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user