Ejemplo n.º 1
0
        public HtmlViewPane(bool showNavigation)
        {
            Dock = DockStyle.Fill;
            Size = new Size(500, 500);

            webBrowser      = new ExtendedWebBrowser();
            webBrowser.Dock = DockStyle.Fill;
            webBrowser.NewWindowExtended += delegate(object sender, NewWindowExtendedEventArgs e)
            {
                e.Cancel = true;
                WorkbenchSingleton.Workbench.ShowView(new BrowserPane(e.Url));
            };
            webBrowser.Navigated += delegate
            {
                // do not use e.Url (frames!)
                urlBox.Text = webBrowser.Url.ToString();

                // Update toolbar:
                foreach (object o in toolStrip.Items)
                {
                    IStatusUpdate up = o as IStatusUpdate;
                    if (up != null)
                    {
                        up.UpdateStatus();
                    }
                }
            };
            Controls.Add(webBrowser);

            if (showNavigation)
            {
                toolStrip           = ToolbarService.CreateToolStrip(this, sButtonsPath);
                toolStrip.GripStyle = ToolStripGripStyle.Hidden;
                Controls.Add(toolStrip);
            }
        }
 public WebBrowserExtendedEvents(ExtendedWebBrowser browser)
 {
     this.browser = browser;
 }