Exemple #1
0
 private void webControl_OpenExternalLink(object sender, OpenExternalLinkEventArgs e)
 {
     if (DockPanel != null)
     {
         WebDocument doc = new WebDocument(e.Url);
         doc.Show(DockPanel);
     }
 }
Exemple #2
0
        //protected override void OnFormClosing( FormClosingEventArgs e )
        //{
        //    // Hide during cleanup.
        //    Hide();

        //    // Close the views and perform cleanup for every tab.
        //    List<Form> contents = new List<Form>( dockPanel.Contents.OfType<Form>() );

        //    foreach ( Form content in contents )
        //        content.Close();

        //    // Save application settings.
        //    Settings.Default.Save();

        //    base.OnFormClosing( e );
        //}

        //protected override void OnFormClosed( FormClosedEventArgs e )
        //{
        //    base.OnFormClosed( e );

        //    // We may not be the last window open.
        //    if ( Application.OpenForms.OfType<BrowserForm>().Count() == 0 )
        //        WebCore.Shutdown();
        //}

        internal WebDocument OpenTab(string url = null, string title = null)
        {
            // - A tab with no url specified, will open WebCore.HomeURL.
            // - A tab with a predefined title, will not display a toolbar
            //   and address-box. This is used to display fixed web content
            //   such as the Help Contents.
            WebDocument doc = String.IsNullOrEmpty(url) ? new WebDocument() :
                              String.IsNullOrEmpty(title) ? new WebDocument(url) : new WebDocument(url, title);

            doc.BrowserForm = this;
            doc.Show(dockPanel);

            return(doc);
        }
Exemple #3
0
        private void historyQueryResultDataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex != 0)
            {
                return;
            }

            if (DockPanel != null)
            {
                HistoryQueryResult source = historyQueryResultBindingSource.DataSource as HistoryQueryResult;

                if (source != null)
                {
                    HistoryEntry entry = source[e.RowIndex];
                    WebDocument  doc   = new WebDocument(entry.Url);
                    doc.Show(DockPanel);
                }
            }
        }
Exemple #4
0
        private void dockPanel_ActiveDocumentChanged(object sender, EventArgs e)
        {
            foreach (WebDocument doc in dockPanel.Documents)
            {
                // We pause WebControl rendering for documents
                // that are currently not visible.
                doc.IsRendering = (doc == dockPanel.ActiveDocument);
            }

            if (dockPanel.ActiveDocument != null)
            {
                WebDocument doc = (WebDocument)dockPanel.ActiveDocument;
                Text = String.Format("{0} - {1}", Application.ProductName, doc.Text);
                doc.Focus();
            }
            else
            {
                Text = Application.ProductName;
            }
        }