Exemplo n.º 1
0
            //public void NewWindow3(ref object pDisp, ref bool cancel, ref object flags, ref object URLContext, ref object URL)
            public void NewWindow3(ref object pDisp, ref bool cancel, uint flags, string URLContext, string URL)
            {
                WebBrowserExtendedNavigatingEventArgs args = new WebBrowserExtendedNavigatingEventArgs(URL.ToString(), null, pDisp);

                _Browser.OnBeforeNewWindow(args);
                cancel = args.Cancel;
                pDisp  = args.AutomationObject;
            }
Exemplo n.º 2
0
        protected void OnBeforeNavigate(WebBrowserExtendedNavigatingEventArgs el)
        {
            EventHandler <WebBrowserExtendedNavigatingEventArgs> h = BeforeNavigate;

            if (null != h)
            {
                h(this, el);
            }
        }
Exemplo n.º 3
0
 private void WebBrowser_BeforeNewWindow(object sender, WebBrowserExtendedNavigatingEventArgs e)
 {
     try
     {
         beforeNewWindow(e);
     }
     catch (Exception ex)
     {
     }
 }
Exemplo n.º 4
0
 private void ucWBEx_Main_BeforeNewWindow(object sender, WebBrowserExtendedNavigatingEventArgs e)
 {
     try
     {
         WebBrowserExtendedNavigatingEventArgs tmpEvent = (WebBrowserExtendedNavigatingEventArgs)e;
         beforeNewWindow(tmpEvent);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 5
0
            //Implement whichever events you wish
            public void BeforeNavigate2(object pDisp, ref object URL, ref object flags, ref object targetFrameName, ref object postData, ref object headers, ref bool cancel)
            {
                string tFrame = null;

                if (targetFrameName != null)
                {
                    tFrame = targetFrameName.ToString();
                }
                WebBrowserExtendedNavigatingEventArgs args = new WebBrowserExtendedNavigatingEventArgs(URL.ToString(), tFrame, pDisp);

                _Browser.OnBeforeNavigate(args);
                cancel = args.Cancel;
                pDisp  = args.AutomationObject;
            }
Exemplo n.º 6
0
        private void beforeNewWindow(WebBrowserExtendedNavigatingEventArgs e)
        {
            //cancel = true will block the popup window
            if (e.Url.ToLower() == "about:blank")
            {
                e.Cancel = false;
                return;
            }
            UCWebBrowserEx newWebBrowser = new UCWebBrowserEx();

            newWebBrowser.BeforeNewWindow   += new EventHandler <WebBrowserExtendedNavigatingEventArgs>(WebBrowser_BeforeNewWindow);
            newWebBrowser.ObjectForScripting = this;
            newWebBrowser.Url  = new Uri(e.Url);
            newWebBrowser.Dock = DockStyle.Fill;

            TabPage newTabPage = new TabPage(Guid.NewGuid().ToString());

            newTabPage.AutoScroll = true;
            newTabPage.Controls.Add(newWebBrowser);
            //newTabPage.Tag = newWebPage;
            this.tabControl_Browser.TabPages.Add(newTabPage);

            this.tabControl_Browser.SelectTab(newTabPage);
        }
Exemplo n.º 7
0
        private void beforeNewWindow(WebBrowserExtendedNavigatingEventArgs e)
        {
            //cancel = true will block the popup window
            if (e.Url.ToLower() == "about:blank")
            {
                e.Cancel = false;
                return;
            }
            UCWebBrowserEx newWebBrowser = new UCWebBrowserEx();
            newWebBrowser.BeforeNewWindow += new EventHandler<WebBrowserExtendedNavigatingEventArgs>(WebBrowser_BeforeNewWindow);
            newWebBrowser.ObjectForScripting = this;
            newWebBrowser.Url = new Uri(e.Url);
            newWebBrowser.Dock = DockStyle.Fill;

            TabPage newTabPage = new TabPage(Guid.NewGuid().ToString());
            newTabPage.AutoScroll = true;
            newTabPage.Controls.Add(newWebBrowser);
            //newTabPage.Tag = newWebPage;
            this.tabControl_Browser.TabPages.Add(newTabPage);

            this.tabControl_Browser.SelectTab(newTabPage);
        }
Exemplo n.º 8
0
 private void WebBrowser_BeforeNewWindow(object sender, WebBrowserExtendedNavigatingEventArgs e)
 {
     try
     {
         beforeNewWindow(e);
     }
     catch (Exception ex)
     {
     }
 }
Exemplo n.º 9
0
 private void ucWBEx_Main_BeforeNewWindow(object sender, WebBrowserExtendedNavigatingEventArgs e)
 {
     try
     {
         WebBrowserExtendedNavigatingEventArgs tmpEvent = (WebBrowserExtendedNavigatingEventArgs)e;
         beforeNewWindow(tmpEvent);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 10
0
 //public void NewWindow3(ref object pDisp, ref bool cancel, ref object flags, ref object URLContext, ref object URL)
 public void NewWindow3(ref object pDisp, ref bool cancel, uint flags, string URLContext, string URL)
 {
     WebBrowserExtendedNavigatingEventArgs args = new WebBrowserExtendedNavigatingEventArgs(URL.ToString(), null, pDisp);
     _Browser.OnBeforeNewWindow(args);
     cancel = args.Cancel;
     pDisp = args.AutomationObject;
 }
Exemplo n.º 11
0
 //Implement whichever events you wish
 public void BeforeNavigate2(object pDisp, ref object URL, ref object flags, ref object targetFrameName, ref object postData, ref object headers, ref bool cancel)
 {
     string tFrame = null;
     if (targetFrameName != null)
         tFrame = targetFrameName.ToString();
     WebBrowserExtendedNavigatingEventArgs args = new WebBrowserExtendedNavigatingEventArgs(URL.ToString(), tFrame, pDisp);
     _Browser.OnBeforeNavigate(args);
     cancel = args.Cancel;
     pDisp = args.AutomationObject;
 }
Exemplo n.º 12
0
        protected void OnBeforeNewWindow(WebBrowserExtendedNavigatingEventArgs el)
        {
            EventHandler<WebBrowserExtendedNavigatingEventArgs> h = BeforeNewWindow;

            if (null != h)
            {
                h(this, el);
            }
        }