Last active
April 12, 2018 17:25
-
-
Save vwmberry95/cedbcd295b837013dae6e706651a10f1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using CefSharp; | |
namespace WindowsFormsApp1 | |
{ | |
public class LoadHandler : ILoadHandler | |
{ | |
public void OnFrameLoadEnd(IWebBrowser browserControl, FrameLoadEndEventArgs e) | |
{ | |
} | |
public void OnFrameLoadStart(IWebBrowser browserControl, FrameLoadStartEventArgs e) | |
{ | |
} | |
public void OnLoadError(IWebBrowser browserControl, LoadErrorEventArgs e) | |
{ | |
if (e.ErrorCode == CefErrorCode.Aborted) | |
return; | |
string html = @" | |
<html> | |
<body> | |
<h1>Oops!</h1> | |
<p>Site can't be reached.</p> | |
</body> | |
</html>"; | |
e.Frame.LoadStringForUrl(html, "http://oops"); | |
} | |
public void OnLoadingStateChange(IWebBrowser browserControl, LoadingStateChangedEventArgs e) | |
{ | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment