public static O2BrowserIE silent(this O2BrowserIE o2BrowserIE, bool value) { return((O2BrowserIE)o2BrowserIE.invokeOnThread( () => { o2BrowserIE.ActiveXInstance.prop("Silent", value); return o2BrowserIE; })); }
public static O2BrowserIE editMode(this O2BrowserIE o2BrowserIE) { return((O2BrowserIE)o2BrowserIE.invokeOnThread( () => { o2BrowserIE.HtmlEditMode = true; return o2BrowserIE; })); }
public static O2BrowserIE set_Text(this O2BrowserIE o2BrowserIE, string text) { return((O2BrowserIE)o2BrowserIE.invokeOnThread( () => { o2BrowserIE.DocumentText = text; return o2BrowserIE; })); }
public static bool contains(this O2BrowserIE o2BrowserIE, List <string> stringsToFind) { foreach (var stringToFind in stringsToFind) { if (o2BrowserIE.text().contains(stringToFind)) { return(true); } } return(false); }
public static IO2Browser add_WebBrowser(this Control control) { return((IO2Browser)control.invokeOnThread( () => { var o2BrowserIE = new O2BrowserIE { Dock = DockStyle.Fill }; control.Controls.Add(o2BrowserIE); return o2BrowserIE; })); }
public static O2BrowserIE cookie(this O2BrowserIE o2BrowserIE, string value) { return((O2BrowserIE)o2BrowserIE.invokeOnThread( () => { var document = o2BrowserIE.document(); if (document != null) { document.Cookie = value; } return o2BrowserIE; })); }
public static O2BrowserIE onEditedHtmlChange(this O2BrowserIE o2BrowserIE, Action <string> onHtmlChange) { return((O2BrowserIE)o2BrowserIE.invokeOnThread(() => { if (o2BrowserIE.Document != null) { var markupContainer2 = (mshtml.IMarkupContainer2)o2BrowserIE.Document.DomDocument; uint pdwCookie; markupContainer2.RegisterForDirtyRange( new IEChangeSink(() => onHtmlChange(o2BrowserIE.html())), out pdwCookie); } return o2BrowserIE; })); }
public static void logBeforeNavigate(this O2BrowserIE o2BrowserIE) { o2BrowserIE.BeforeNavigate += (URL, flags, postData, headers) => { "on before Navigate for {0}".format(URL).debug(); if (postData != null) { "post flags: {0}".format(flags).info(); "post headers: {0}".format(headers).info(); "post url: {0}".format(URL).info(); "post data: {0}".format(((byte[])postData).ascii()).info(); } }; }
public static WPF_GUI showMessage(this WPF_GUI wpf_Gui, O2BrowserIE browser, string title, string message, string url) { O2Thread.mtaThread( () => { var htmlMessage = ("<html><body cellspacing=\"0\" cellpadding=\"0\"><font face=Arial><center>".line() + " <h2>{1}</h2>".line() + " <h3>{2}</h3>".line() + " <img src=\"{0}\"/>" + "</center>".line() + ((url).valid() ? "<div style=\"position:absolute; bottom:0px;width:100%;font-size:xx-small;\"><center>showing help page: <a href=\"{3}\"target=blank>{3}</a></center></div>".line() + "<iframe src =\"{3}\" style=\"position:absolute; bottom:15px; height=70%; width:100%;\"/>".line() : "") + "</font></body></html>") .format("O2Logo_Small.gif".local(), title, message, url); browser.set_Text(htmlMessage); }); return(wpf_Gui); }
public static HtmlDocument document(this O2BrowserIE o2BrowserIE) { return((HtmlDocument)o2BrowserIE.invokeOnThread(() => o2BrowserIE.Document)); }
public static WPF_GUI showOffineMessage(this WPF_GUI wpf_Gui, O2BrowserIE browser, string message) { return(wpf_Gui.showMessage(browser, "You are offline at the moment", message)); }
public static O2BrowserIE clearCookie(this O2BrowserIE o2BrowserIE) { return(o2BrowserIE.cookie("")); }
public static string html(this O2BrowserIE o2BrowserIE) { return(o2BrowserIE.text()); }
public static string cookie(this O2BrowserIE o2BrowserIE) { return((string)o2BrowserIE.invokeOnThread(() => o2BrowserIE.document().Cookie)); }
public static string text(this O2BrowserIE o2BrowserIE) { return((string)o2BrowserIE.invokeOnThread(() => o2BrowserIE.DocumentText)); }
public static O2BrowserIE openBlank(this O2BrowserIE o2BrowserIE) { o2BrowserIE.openSync("about:blank"); return(o2BrowserIE); }
public static ExtendedWebBrowser.IWebBrowser2 activeX(this O2BrowserIE o2BrowserIE) { return((ExtendedWebBrowser.IWebBrowser2)o2BrowserIE.ActiveXInstance); }
public static O2BrowserIE onTextChange(this O2BrowserIE o2BrowserIE, Action <string> callback) { return(o2BrowserIE.onEditedHtmlChange(callback)); }
public static WPF_GUI showMessage(this WPF_GUI wpf_Gui, O2BrowserIE browser, string title, string message) { return(wpf_Gui.showMessage(title, message, "")); }
public static bool contains(this O2BrowserIE o2BrowserIE, string stringToFind) { return(o2BrowserIE.text().contains(stringToFind)); }