Exemplo n.º 1
0
        public NativeContainer()
        {
            InitializeComponent();
            //this.autoHideHandler.start();
            Gecko.Xpcom.Initialize(Application.StartupPath + XULRUNNERPATH);
            //GeckoPreferences.User["gfx.font_rendering.graphite.enabled"] = true;
            browser = new GeckoWebBrowser();
            browser.Parent = this;
            browser.Dock = DockStyle.Fill;
            browser.DocumentCompleted += browser_DocumentCompleted;
            browser.DomClick += browser_DomClick;
            browser.CreateControl();

            this.Width = Convert.ToInt32(ConfigurationManager.AppSettings["WindowWidth"]);
            this.Height = Convert.ToInt32(ConfigurationManager.AppSettings["WindowHeight"]);
            this.Left = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Right - this.Width;
            this.Top = 0;
            this.FormBorderStyle = FormBorderStyle.Fixed3D;
        }
Exemplo n.º 2
0
        private void GekoBrowser_Load(object sender, EventArgs e)
        {
            Gecko.Xpcom.Initialize(Application.StartupPath + XULRUNNERPATH);
            browser = new GeckoWebBrowser();
            browser.Dock = DockStyle.Fill;
            this.Controls.Add(browser);
            browser.Parent = this;
            browser.Dock = DockStyle.Fill;

            this.FormBorderStyle = FormBorderStyle.FixedToolWindow;
            browser.DocumentCompleted += browser_DocumentCompleted;
            browser.CreateControl();
            browser.Navigate(this.m_Url);
        }
Exemplo n.º 3
0
        private GeckoWebBrowser MakeNewBrowser()
        {
            Debug.WriteLine("making browser");

            var browser = new GeckoWebBrowser();
            browser.HandleCreated += new EventHandler(OnBrowser_HandleCreated);
            browser.CreateControl();
            var giveUpTime = DateTime.Now.AddSeconds(2);
            while (!_browserHandleCreated && DateTime.Now < giveUpTime)
            {
                //TODO: could lead to hard to reproduce bugs
                Application.DoEvents();
                Thread.Sleep(100);
            }
            return browser;
        }