c# - Awesomium not loading page or triggering any events -
i want simple loading webpage. reason awesomium not updating properties such isloading, or triggering events such documentready or loadingframecomplete , have no idea why, can me out?
using system; using system.collections.generic; using system.linq; using system.text; using system.threading.tasks; using awesomium.core; namespace downloadertest { class parsinghelper { webview wv; public parsinghelper(webview web) { this.wv = web; } public void parsinginitiation(string link) { wv.loadingframecomplete +=wv_loadingframecomplete; wv.source = new uri(link); } void wv_loadingframecomplete(object sender, frameeventargs e) { if(e.ismainframe) { //beginparsing ((webview)sender).loadingframecomplete -= wv_loadingframecomplete; } } } class teste { webview mainweb = webcore.createwebview(1024,768); public object[] obtaininformation(int id) { parsinghelper ph = new parsinghelper(mainweb); ph.parsinginitiation("http://www.google.com"); //more code return new object[] {}; } } }
if run like...
teste t = new teste(); t.obtaininformation(1);
wv_loadingframecomplete
never triggered , have no idea why.
try code detect page loaded loadingframecompete event + isloading property
private void awesomium_windows_forms_webcontrol_loadingframecomplete(object sender, awesomium.core.frameeventargs e) { if (!webcontrol1.isloading) messagebox.show("page loaded completely"); }
Comments
Post a Comment