Add Cef.Initialize check in constructor of WinForms and OffScreen implementations - makes them consistent with the WPF version.

This commit is contained in:
amaitland
2015-02-02 18:17:40 +10:00
parent 4405d55221
commit c1d44dbcbb
2 changed files with 10 additions and 0 deletions
+5
View File
@@ -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);
+5
View File
@@ -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;