예제 #1
0
 public static O2BrowserIE silent(this O2BrowserIE o2BrowserIE, bool value)
 {
     return((O2BrowserIE)o2BrowserIE.invokeOnThread(
                () =>
     {
         o2BrowserIE.ActiveXInstance.prop("Silent", value);
         return o2BrowserIE;
     }));
 }
예제 #2
0
 public static O2BrowserIE editMode(this O2BrowserIE o2BrowserIE)
 {
     return((O2BrowserIE)o2BrowserIE.invokeOnThread(
                () =>
     {
         o2BrowserIE.HtmlEditMode = true;
         return o2BrowserIE;
     }));
 }
예제 #3
0
 public static O2BrowserIE set_Text(this O2BrowserIE o2BrowserIE, string text)
 {
     return((O2BrowserIE)o2BrowserIE.invokeOnThread(
                () =>
     {
         o2BrowserIE.DocumentText = text;
         return o2BrowserIE;
     }));
 }
예제 #4
0
 public static bool contains(this O2BrowserIE o2BrowserIE, List <string> stringsToFind)
 {
     foreach (var stringToFind in stringsToFind)
     {
         if (o2BrowserIE.text().contains(stringToFind))
         {
             return(true);
         }
     }
     return(false);
 }
예제 #5
0
 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;
     }));
 }
예제 #6
0
 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;
     }));
 }
예제 #7
0
        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;
            }));
        }
예제 #8
0
 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();
         }
     };
 }
예제 #9
0
        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);
        }
예제 #10
0
 public static HtmlDocument document(this O2BrowserIE o2BrowserIE)
 {
     return((HtmlDocument)o2BrowserIE.invokeOnThread(() => o2BrowserIE.Document));
 }
예제 #11
0
 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));
 }
예제 #12
0
 public static O2BrowserIE clearCookie(this O2BrowserIE o2BrowserIE)
 {
     return(o2BrowserIE.cookie(""));
 }
예제 #13
0
 public static string html(this O2BrowserIE o2BrowserIE)
 {
     return(o2BrowserIE.text());
 }
예제 #14
0
 public static string cookie(this O2BrowserIE o2BrowserIE)
 {
     return((string)o2BrowserIE.invokeOnThread(() => o2BrowserIE.document().Cookie));
 }
예제 #15
0
 public static string text(this O2BrowserIE o2BrowserIE)
 {
     return((string)o2BrowserIE.invokeOnThread(() => o2BrowserIE.DocumentText));
 }
예제 #16
0
 public static O2BrowserIE openBlank(this O2BrowserIE o2BrowserIE)
 {
     o2BrowserIE.openSync("about:blank");
     return(o2BrowserIE);
 }
예제 #17
0
 public static ExtendedWebBrowser.IWebBrowser2 activeX(this O2BrowserIE o2BrowserIE)
 {
     return((ExtendedWebBrowser.IWebBrowser2)o2BrowserIE.ActiveXInstance);
 }
예제 #18
0
 public static O2BrowserIE onTextChange(this O2BrowserIE o2BrowserIE, Action <string> callback)
 {
     return(o2BrowserIE.onEditedHtmlChange(callback));
 }
예제 #19
0
 public static WPF_GUI showMessage(this WPF_GUI wpf_Gui, O2BrowserIE browser, string title, string message)
 {
     return(wpf_Gui.showMessage(title, message, ""));
 }
예제 #20
0
 public static bool contains(this O2BrowserIE o2BrowserIE, string stringToFind)
 {
     return(o2BrowserIE.text().contains(stringToFind));
 }