public static void Prepare(this WebBrowser browser, Action <WebBrowser, mshtml.IHTMLElement> onReady) { var helper = new WebBrowserEvt(browser); if (onReady != null) { browser.Navigated += new NavigatedEventHandler((s, e) => { if (browser.Document != null) { var doc = browser.Document as mshtml.IHTMLDocument3; if (doc != null) { onReady(browser, doc.documentElement); } } }); } }
public static WebBrowserEvt Prepare(this WebBrowser browser) { var helper = new WebBrowserEvt(browser); return(helper); }