Exemplo n.º 1
0
 /// <summary>
 /// Creates a webpage module
 /// </summary>
 public WebPage()
 {
     this.browser      = new SkipDialogBrowser();
     this.uuid         = Utils.NewUid();
     this.browser.Size = new Size(400, 300);
     this.browser.ScrollBarsEnabled = false;
     // Add WebBrowser external scripting support
     this.browser.DocumentCompleted += DocumentCompleted;
     this.browser.Navigated         += Navigated;
     this.browser.Navigate("about:blank");
     while (loading)
     {
         Application.DoEvents();
     }
     //this.browser.InitialiseOLE();
     this.browser.ObjectForScripting     = new Callback.External(this);
     this.browser.ScriptErrorsSuppressed = true;
     // Initialize properties
     this.customHeaders = new Dictionary <string, object>();
     this.zoomFactor    = 1;
     this.clipRect      = new Dictionary <string, object>()
     {
         { "top", 0 },
         { "left", 0 },
         { "width", 0 },
         { "height", 0 }
     };
 }
Exemplo n.º 2
0
 /// <summary>
 /// Creates a webpage module
 /// </summary>
 public WebPage()
 {
     this.uuid         = Utils.NewUid();
     this.browser      = new SkipDialogBrowser();
     this.browser.Size = new Size(400, 300);
     // Add events
     this.browser.ActiveXBrowser.BeforeNavigate2 += BeforeNavigate2;
     this.browser.Navigated         += Navigated;
     this.browser.DocumentCompleted += DocumentCompleted;
     this.browser.NewWindow         += NewWindow;
     this.browser.Navigate("about:blank");
     while (loading)
     {
         Application.DoEvents();
     }
     //this.browser.InitialiseOLE();
     // Add WebBrowser external scripting support
     this.browser.ObjectForScripting = new Callback.External(this);
     // Initialize properties
     this.libraryPath   = Phantom.libraryPath;
     this.customHeaders = new Dictionary <string, object>();
     this.zoomFactor    = 1;
     this.clipRect      = new Dictionary <string, object>()
     {
         { "top", 0 },
         { "left", 0 },
         { "width", 0 },
         { "height", 0 }
     };
 }
Exemplo n.º 3
0
 /// <summary>
 /// Closes the page and releases memory
 /// </summary>
 public void close()
 {
     callbackStack.Clear();
     if (browser != null)
     {
         browser.Dispose();
         browser = null;
     }
 }