public void checkForFirefoxInstallation()
        {
            /*    O2Thread.mtaThread(
             *      () =>
             *          {
             *              Processes.Sleep(1000);*/
            if (false == allOkWithFirefoxControl)
            {
                scGeckoBrowserAndTabControl.invokeOnThread(
                    () =>
                {
                    try
                    {
                        if (FirefoxXul.is64BitOs())
                        {
                            scGeckoBrowserAndTabControl.Panel2Collapsed = true;
                            scGeckoBrowserAndTabControl.Panel1.Controls.Add(new ascx_x64 {
                                Dock = DockStyle.Fill
                            });
                        }
                        else if (false == FirefoxXul.isFirefoxInstalled())
                        {
                            scGeckoBrowserAndTabControl.Panel2Collapsed = true;
                            scGeckoBrowserAndTabControl.Panel1.Controls.Add(
                                new ascx_InstallFirefox(checkForFirefoxInstallation)
                            {
                                Dock = DockStyle.Fill
                            });
                        }
                        else
                        {
                            scGeckoBrowserAndTabControl.Panel2Collapsed = false;
                            webBrowser = FirefoxXul.createGeckoWebBrowser();
                            if (webBrowser != null)
                            {
                                scGeckoBrowserAndTabControl.Panel1.Controls.Clear();
                                var toString = webBrowser.ToString();
                                scGeckoBrowserAndTabControl.Panel1.Controls.Add(webBrowser);
                                btOpenRequestInWebBrowser_Click(null, null);
                                webBrowser.DocumentCompleted +=
                                    (sender, e) => analyzeLoadedUrlHtmlObjects();
                                allOkWithFirefoxControl = true;
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        DI.log.error("in checkForFirefoxInstallation: {0}", ex.Message);
                    }
                });
            }

            /*
             *      });        */
        }
Beispiel #2
0
        public static GeckoWebBrowser add_Firefox2(this Control control)
        {
            PublicDI.log.debug("in add_Firefox");
            return((GeckoWebBrowser)control.invokeOnThread(
                       () =>
            {
                PublicDI.log.debug("in add_Firefox: Thread");
                var firefoxWebBrowser = FirefoxXul.createGeckoWebBrowser();
                if (firefoxWebBrowser != null)
                {
                    PublicDI.log.info(firefoxWebBrowser.GetType().FullName);
                    control.Controls.Add(firefoxWebBrowser);
                    return firefoxWebBrowser;
                }
                PublicDI.log.error("Could not create Firefox WebBrowser control");

                return null;
            }));
        }
Beispiel #3
0
 private void checkIfFireFoxIsAvailable()
 {
     tbPathToFirefoxDirectory.BackColor = (FirefoxXul.isFirefoxInstalled()) ? Color.LightGreen : Color.LightPink;
 }