Revert "WinForms Example - Load Url after browser initialized"

This reverts commit a8ee0b586df69048f6d56c6398ed977660977368.
This commit is contained in:
amaitland 2018-02-08 15:17:45 +10:00
parent ca7ddc1a18
commit 3efdb5642c

View File

@ -20,7 +20,7 @@ namespace CefSharp.MinimalExample.WinForms
Text = "CefSharp";
WindowState = FormWindowState.Maximized;
browser = new ChromiumWebBrowser()
browser = new ChromiumWebBrowser("www.google.com")
{
Dock = DockStyle.Fill,
};
@ -31,21 +31,12 @@ namespace CefSharp.MinimalExample.WinForms
browser.StatusMessage += OnBrowserStatusMessage;
browser.TitleChanged += OnBrowserTitleChanged;
browser.AddressChanged += OnBrowserAddressChanged;
browser.IsBrowserInitializedChanged += OnIsBrowserInitializedChanged;
var bitness = Environment.Is64BitProcess ? "x64" : "x86";
var version = String.Format("Chromium: {0}, CEF: {1}, CefSharp: {2}, Environment: {3}", Cef.ChromiumVersion, Cef.CefVersion, Cef.CefSharpVersion, bitness);
DisplayOutput(version);
}
private void OnIsBrowserInitializedChanged(object sender, IsBrowserInitializedChangedEventArgs e)
{
if(e.IsBrowserInitialized)
{
browser.Load("www.google.com");
}
}
private void OnBrowserConsoleMessage(object sender, ConsoleMessageEventArgs args)
{
DisplayOutput(string.Format("Line: {0}, Source: {1}, Message: {2}", args.Line, args.Source, args.Message));