Ejemplo n.º 1
0
 protected void OnStartNewWindow(BrowserExtendedNavigatingEventArgs e)
 {
     if (e == null)
     {
         throw new ArgumentNullException("e");
     }
     if (this.StartNewWindow != null)
     {
         this.StartNewWindow(this, e);
     }
 }
Ejemplo n.º 2
0
            public void BeforeNavigate2(object pDisp, ref object URL, ref object flags, ref object targetFrameName, ref object postData, ref object headers, ref bool cancel)
            {
                Uri    url   = new Uri(URL.ToString());
                string frame = null;

                if (targetFrameName != null)
                {
                    frame = targetFrameName.ToString();
                }
                BrowserExtendedNavigatingEventArgs e = new BrowserExtendedNavigatingEventArgs(pDisp, url, frame, UrlContext.None);

                this._Browser.OnStartNavigate(e);
                cancel = e.Cancel;
                pDisp  = e.AutomationObject;
            }
Ejemplo n.º 3
0
 public void NewWindow3(ref object ppDisp, ref bool Cancel, uint dwFlags, string bstrUrlContext, string bstrUrl)
 {
     BrowserExtendedNavigatingEventArgs e = new BrowserExtendedNavigatingEventArgs(ppDisp, new Uri(bstrUrl), null, (UrlContext) dwFlags);
     this._Browser.OnStartNewWindow(e);
     Cancel = e.Cancel;
     ppDisp = e.AutomationObject;
 }
Ejemplo n.º 4
0
 public void NewWindow2(ref object pDisp, ref bool cancel)
 {
     BrowserExtendedNavigatingEventArgs e = new BrowserExtendedNavigatingEventArgs(pDisp, null, null, UrlContext.None);
     this._Browser.OnStartNewWindow(e);
     cancel = e.Cancel;
     pDisp = e.AutomationObject;
 }
Ejemplo n.º 5
0
 public void BeforeNavigate2(object pDisp, ref object URL, ref object flags, ref object targetFrameName, ref object postData, ref object headers, ref bool cancel)
 {
     Uri url = new Uri(URL.ToString());
     string frame = null;
     if (targetFrameName != null)
     {
         frame = targetFrameName.ToString();
     }
     BrowserExtendedNavigatingEventArgs e = new BrowserExtendedNavigatingEventArgs(pDisp, url, frame, UrlContext.None);
     this._Browser.OnStartNavigate(e);
     cancel = e.Cancel;
     pDisp = e.AutomationObject;
 }
Ejemplo n.º 6
0
 protected void OnStartNewWindow(BrowserExtendedNavigatingEventArgs e)
 {
     if (e == null)
     {
         throw new ArgumentNullException("e");
     }
     if (this.StartNewWindow != null)
     {
         this.StartNewWindow(this, e);
     }
 }
Ejemplo n.º 7
0
 private void _browser_StartNewWindow(object sender, BrowserExtendedNavigatingEventArgs e)
 {
     WebBrowserEx mainFormFromControl = GetMainFormFromControl(sender as Control);
     if (mainFormFromControl != null)
     {
         bool flag = (e.NavigationContext == UrlContext.None) || ((e.NavigationContext & UrlContext.OverrideKey) == UrlContext.OverrideKey);
         if (!flag)
         {
             flag = true;
         }
         if (flag)
         {
             if ((e.NavigationContext & UrlContext.HtmlDialog) != UrlContext.HtmlDialog)
             {
                 ExtendedWebBrowser browser = mainFormFromControl.WindowManager.New(false);
                 e.AutomationObject = browser.Application;
             }
         }
         else
         {
             e.Cancel = true;
         }
     }
 }