Exemplo n.º 1
0
        public WebBrowserControl OpenNewWindow(string url)
        {
            WebBrowserControl wbc = OpenNewWindow();

            wbc.Navigate(url);
            return(wbc);
        }
Exemplo n.º 2
0
        void ObjWebBrowser_CreateWindow(object sender, GeckoCreateWindowEventArgs e)
        {
            WebBrowserHostControl wbhc = MainWindowServiceDispatcher.Instance.OpenWebBrowser();
            WebBrowserControl     wbc  = wbhc.OpenNewWindow();

            e.WebBrowser = wbc.ObjWebBrowser;
        }
Exemplo n.º 3
0
 internal void ObjWebBrowser_LoadCompleted(WebBrowserControl wbc)
 {
     if (wbc == active_wbc)
     {
         if (null != PageLoaded)
         {
             PageLoaded();
         }
     }
 }
Exemplo n.º 4
0
        public WebBrowserControl OpenNewWindow()
        {
            WebBrowserControl wbc = new WebBrowserControl(this);

            string unique_tab_name = Guid.NewGuid().ToString();

            TabWebBrowserControls.AddContent(unique_tab_name, "Browser", Icons.GetAppIcon(Icons.ModuleWebBrowser), true, true, wbc);

            return(wbc);
        }
Exemplo n.º 5
0
        internal void ObjWebBrowser_Navigating(WebBrowserControl wbc, Uri uri)
        {
            lblHintHowToUse.Visibility = Visibility.Hidden;

            if (wbc == active_wbc)
            {
                TextBoxUrl.Text = uri.ToString();
                TextBoxUrl.SelectAll();

                if (null != Navigating)
                {
                    Navigating(uri);
                }
            }
        }
Exemplo n.º 6
0
        void TabWebBrowserControls_OnActiveItemChanged(FrameworkElement newItemContent)
        {
            WebBrowserControl wbc = newItemContent as WebBrowserControl;

            if (null != wbc)
            {
                wbc.NavigateToPendingOnceVisibleUri();

                Logging.Info("Active browser control changed");
                active_wbc = wbc;

                Uri uri = wbc.CurrentUri;
                TextBoxUrl.Text = uri == null ? String.Empty : uri.ToString();
            }

            if (null != TabChanged)
            {
                TabChanged();
            }
        }
Exemplo n.º 7
0
        public WebBrowserHostControl()
        {
            Logging.Info("+WebBrowserHostControl()");

            InitializeComponent();

            bool ADVANCED_MENUS = ConfigurationManager.Instance.ConfigurationRecord.GUI_AdvancedMenus;

            ButtonNewBrowser.Icon = Icons.GetAppIcon(Icons.New);
            if (!ADVANCED_MENUS)
            {
                ButtonNewBrowser.Caption = "New";
            }
            ButtonNewBrowser.ToolTip = "Open a new browsing window.";
            ButtonNewBrowser.Click  += ButtonNewBrowser_Click;

            ButtonBack.Icon = Icons.GetAppIcon(Icons.Back);
            if (!ADVANCED_MENUS)
            {
                ButtonBack.Caption = "Back";
            }
            ButtonBack.ToolTip = "Browse back";
            ButtonBack.Click  += ButtonBack_Click;

            ButtonForward.Icon = Icons.GetAppIcon(Icons.Forward);
            if (!ADVANCED_MENUS)
            {
                ButtonForward.Caption = "Forward";
            }
            ButtonForward.ToolTip = "Browse forward";
            ButtonForward.Click  += ButtonForward_Click;

            TextBoxUrl.ToolTip         = "Enter the web address here and press <ENTER>";
            TextBoxUrl.EmptyTextPrompt = "Enter web address";
            TextBoxUrl.OnHardSearch   += TextBoxUrl_OnHardSearch;

            TextBoxGoogleScholar.ToolTip       = "Enter your search keywords here and press <ENTER>";
            TextBoxGoogleScholar.OnHardSearch += TextBoxGoogleScholar_OnHardSearch;

            ButtonEZProxy.Icon = Icons.GetAppIcon(Icons.WebEZProxy);
            if (!ADVANCED_MENUS)
            {
                ButtonEZProxy.Caption = "EZProxy";
            }
            ButtonEZProxy.ToolTip = "View this web page using EZProxy.";
            ButtonEZProxy.Click  += ButtonEZProxy_Click;

            ButtonPrint.Icon = Icons.GetAppIcon(Icons.Printer);
            if (!ADVANCED_MENUS)
            {
                ButtonPrint.Caption = "Print";
            }
            ButtonPrint.ToolTip = "Print this web page.";
            ButtonPrint.Click  += ButtonPrint_Click;

            ButtonGrabWebPage.Icon = Icons.GetAppIcon(Icons.WebGrabWebPage);
            if (!ADVANCED_MENUS)
            {
                ButtonGrabWebPage.Caption = "Convert\nto PDF";
            }
            ButtonGrabWebPage.ToolTip = "Convert the current page into a PDF and add it to your library.";
            ButtonGrabWebPage.Click  += ButtonGrabWebPage_Click;

            ButtonGrabPDFs.Icon = Icons.GetAppIcon(Icons.WebGrabPDFs);
            if (!ADVANCED_MENUS)
            {
                ButtonGrabPDFs.Caption = "Grab all\nPDFs";
            }
            ButtonGrabPDFs.ToolTip = "Downloads all the PDFs that are accessible from this web page.";
            ButtonGrabPDFs.Click  += ButtonGrabPDFs_Click;


            /*
             * ButtonAddToLibrary.Icon = Icons.GetAppIcon(Icons.WebAddToLibrary);
             * if (!ADVANCED_MENUS) ButtonAddToLibrary.Caption = "Add PDF to\nLibrary";
             * ButtonAddToLibrary.ToolTip = "Add the currently displayed page to your library (must be a PDF).";
             * ButtonAddToLibrary.Click += new RoutedEventHandler(ButtonAddToLibrary_Click);
             */

            web_searcher_preference_control = new WebSearcherPreferenceControl(this);
            wbc_browsing = new WebBrowserControl(this);

            TabWebBrowserControls.OnActiveItemChanged += TabWebBrowserControls_OnActiveItemChanged;

            RebuildSearchers();

            Logging.Info("-WebBrowserHostControl()");
        }