/// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.explorerBrowserControl = new OpenLiveWriter.BrowserControl.ExplorerBrowserControl();
     this.SuspendLayout();
     //
     // explorerBrowserControl
     //
     this.explorerBrowserControl.Dock        = System.Windows.Forms.DockStyle.Fill;
     this.explorerBrowserControl.Location    = new System.Drawing.Point(1, 1);
     this.explorerBrowserControl.Name        = "explorerBrowserControl";
     this.explorerBrowserControl.Silent      = true;
     this.explorerBrowserControl.Size        = new System.Drawing.Size(326, 278);
     this.explorerBrowserControl.TabIndex    = 0;
     this.explorerBrowserControl.TextSize    = OpenLiveWriter.BrowserControl.TextSize.Medium;
     this.explorerBrowserControl.WorkOffline = false;
     //
     // MapControl
     //
     this.Controls.Add(this.explorerBrowserControl);
     this.DockPadding.All = 1;
     this.Name            = "MapControl";
     this.Size            = new System.Drawing.Size(328, 280);
     this.Controls.SetChildIndex(this.explorerBrowserControl, 0);
     this.ResumeLayout(false);
 }
        public HtmlScreenCaptureForm(HtmlScreenCaptureCore htmlScreenCaptureCore)
        {
            // save reference to parent object
            _htmlScreenCaptureCore = htmlScreenCaptureCore;

            // set the timeout time
            _timeoutTime = DateTime.Now.AddMilliseconds(_htmlScreenCaptureCore.TimeoutMs);

            // create and add the underlying browser control
            _browserControl        = new ExplorerBrowserControl();
            _browserControl.Silent = true;

            Controls.Add(_browserControl);
        }
示例#3
0
        /// <summary>
        /// Constructs a new WebPageDownloader, permits script execution by default
        /// </summary>
        public WebPageDownloader(Control parentControl, WinInetCredentialsContext credentialsContext)
        {
            // create the undelrying control
            browserControl = new ExplorerBrowserControl();

            if (parentControl != null)
            {
                browserControl.Parent = parentControl;
            }

            browserControl.DownloadOptions = GetDownloadOptions();

            CredentialsContext = credentialsContext;

            // configure options
            browserControl.Silent = true;
        }
        /// <summary>
        /// Initialize the downloader
        /// </summary>
        public WebPageDownloader()
        {
            // create the undelrying control
            browserControl = new ExplorerBrowserControl() ;

            // set us as the client site
            // http://www.codeproject.com/books/0764549146_8.asp
            // http://discuss.develop.com/archives/wa.exe?A2=ind0205A&L=DOTNET&D=0&P=15756
            IOleObject oleObject = (IOleObject)browserControl.Browser ;
            oleObject.SetClientSite( this ) ;

            // configure options
            browserControl.Browser.Silent = true ;

            // subscribe to events
            browserControl.ProgressChange +=new BrowserProgressChangeEventHandler(browserControl_ProgressChange);
            browserControl.DocumentComplete +=new BrowserDocumentEventHandler(browserControl_DocumentComplete);
            browserControl.NewWindow2 +=new Project31.BrowserControl.DWebBrowserEvents2_NewWindow2EventHandler(browserControl_NewWindow2);
        }
示例#5
0
        /// <summary>
        /// Initialize the downloader
        /// </summary>
        public WebPageDownloader()
        {
            // create the underlying control
            browserControl = new ExplorerBrowserControl();

            // set us as the client site
            // http://www.codeproject.com/books/0764549146_8.asp
            // http://discuss.develop.com/archives/wa.exe?A2=ind0205A&L=DOTNET&D=0&P=15756
            IOleObject oleObject = (IOleObject)browserControl.Browser;

            oleObject.SetClientSite(this);

            // configure options
            browserControl.Browser.Silent = true;

            // subscribe to events
            browserControl.ProgressChange   += new BrowserProgressChangeEventHandler(browserControl_ProgressChange);
            browserControl.DocumentComplete += new BrowserDocumentEventHandler(browserControl_DocumentComplete);
            browserControl.NewWindow2       += new Project31.BrowserControl.DWebBrowserEvents2_NewWindow2EventHandler(browserControl_NewWindow2);
        }
 /// <summary>
 /// Clean up any resources being used.
 /// </summary>
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (explorerBrowserControl != null)
         {
             explorerBrowserControl.DocumentComplete -= new BrowserDocumentEventHandler(explorerBrowserControl_DocumentComplete);
             explorerBrowserControl.Dispose();
             explorerBrowserControl = null;
         }
         if (MapActiveObject != null)
         {
             MapActiveObject = null;
         }
         if (components != null)
         {
             components.Dispose();
         }
     }
     base.Dispose(disposing);
 }
            private void BackgroundMain()
            {
                try
                {
                    using (form = new Form())
                    {
                        form.Size = new Size(browserWidth, browserHeight);

                        browser                   = new ExplorerBrowserControl();
                        browser.Dock              = DockStyle.Fill;
                        browser.Silent            = true;
                        browser.DocumentComplete += Handler;
                        form.Controls.Add(browser);
                        form.CreateControl();
                        browser.Navigate(url);

                        Application.Run();
                    }
                }
                catch (Exception e)
                {
                    Trace.Fail(e.ToString());
                }
            }