Exemplo n.º 1
0
        /// <summary>
        /// Creates a new browser tab
        ///
        /// </summary>
        /// <param name="identifier">The unique identifier of the browser tab is the url</param>
        /// <returns></returns>
        private ITab CreateBrowser(string identifier)
        {
            BrowserTab tab = new BrowserTab();

            tab.AxWebBrowser.NewWindow3 += new DWebBrowserEvents2_NewWindow3EventHandler(AxWebBrowser_NewWindow3);
            tab.AxWebBrowser.NewWindow2 += new DWebBrowserEvents2_NewWindow2EventHandler(AxWebBrowser_NewWindow2);
            //you don't want to pile up unaccessible browsers!
            tab.Closing += new System.ComponentModel.CancelEventHandler(tab_Closing);

            if (identifier == "Home")
            {
                tab.Identifier = "Home";
                tab.Navigate("about:blank");                //this one seems really necessary
                tab.AxWebBrowser.Html         = defaultHtml;
                tab.AxWebBrowser.ScriptObject = this.mediator;
            }
            else if (identifier == string.Empty)
            {
                tab.Identifier = "Empty";
                tab.Navigate("about:blank");                //this one seems really necessary
            }
            else
            {
                tab.Identifier = identifier;
                tab.Navigate(identifier);
            }
            tabs.Add(tab);
            if (OnNewTab != null)
            {
                OnNewTab(tab);
            }
            return(tab);
        }
Exemplo n.º 2
0
        public void CloneTab(object sender, object e)
        {
            BrowserTab cloneTab = new BrowserTab();

            cloneTab.Browser.Address = Browser.Address;
            ((TabControl)Parent).Items.Add(cloneTab);
        }
Exemplo n.º 3
0
        private void MainGrid_OnMouseUp(object sender, MouseButtonEventArgs e)
        {
            HistoryTable Current = MainGrid.SelectedItem as HistoryTable;
            BrowserTab   NewTab  = new BrowserTab();

            NewTab.Browser.Address = Current.URL;
            (Tag as MainWindow).Tabs.Items.Add(NewTab);
            this.Close();
        }
Exemplo n.º 4
0
        private void tabFactory_OnNewTab(ITab tab)
        {
            switch (tab.TabType)
            {
            case TabTypes.Favorites:
                tab.Show(parent.dockPanel, DockState.DockRightAutoHide);
                break;

            case TabTypes.Browser:
                tab.Show(parent.dockPanel, DockState.Document);
                BrowserTab fulltab = tab as BrowserTab;
                fulltab.OnDocumentComplete += new WebBrowser.BrowserTab.BrowserTabInfo(OnBrowserDocumentComplete);
                break;
            }
        }
Exemplo n.º 5
0
        private void OnBrowserDocumentComplete(BrowserTab tab)
        {
            //check if already in the list
            for (int k = 0; k < parent.mnuWindows.MenuItems.Count; k++)
            {
                if (parent.mnuWindows.MenuItems[k].Text == tab.Text)
                {
                    return;
                }
            }

            MenuItemEx item = new MenuItemEx(tab.Text, new EventHandler(WindowsClick));

            item.MergeType = MenuMerge.MergeItems;
            item.Tab       = tab;
            parent.mnuWindows.MenuItems.Add(item);
        }
Exemplo n.º 6
0
        public void NewTab(object sender, object e)
        {
            BrowserTab addTab = new BrowserTab();

            ((TabControl)Parent).Items.Add(addTab);
        }
Exemplo n.º 7
0
        private void OnFormLoad(object sender, RoutedEventArgs e)
        {
            BrowserTab NewTab = new BrowserTab();

            Tabs.Items.Add(NewTab);
        }