Example #1
0
 protected virtual void OnBeforeNavigate2Frame(BrowserBeforeNavigate2EventArgs e)
 {
     if (BeforeNavigate2Frame != null)
     {
         BeforeNavigate2Frame(this, e);
     }
 }
Example #2
0
 protected virtual void OnBeforeNavigate2Document(BrowserBeforeNavigate2EventArgs e)
 {
     if (BeforeNavigate2Document != null)
     {
         BeforeNavigate2Document(this, e);
     }
 }
Example #3
0
        private void AxWebBrowser_BeforeNavigate2(object sender, DWebBrowserEvents2_BeforeNavigate2Event e)
        {
            BrowserBeforeNavigate2EventArgs args = new BrowserBeforeNavigate2EventArgs(e);

            IntPtr thisPtr    = Marshal.GetIDispatchForObject(e.pDisp);
            IntPtr browserPtr = Marshal.GetIDispatchForObject(m_browser.GetOcx());
            bool   isDocument = (thisPtr == browserPtr);

            Marshal.Release(thisPtr);
            Marshal.Release(browserPtr);

            if (isDocument)
            {
                OnBeforeNavigate2Document(args);
            }
            else
            {
                OnBeforeNavigate2Frame(args);
            }

            args.PutBack(e);
        }
        private void AxWebBrowser_BeforeNavigate2(object sender, DWebBrowserEvents2_BeforeNavigate2Event e)
        {
            BrowserBeforeNavigate2EventArgs args = new BrowserBeforeNavigate2EventArgs(e);

            IntPtr thisPtr = Marshal.GetIDispatchForObject(e.pDisp);
            IntPtr browserPtr = Marshal.GetIDispatchForObject(m_browser.GetOcx());
            bool isDocument = (thisPtr == browserPtr);
            Marshal.Release(thisPtr);
            Marshal.Release(browserPtr);

            if (isDocument)
                OnBeforeNavigate2Document(args);
            else
                OnBeforeNavigate2Frame(args);

            args.PutBack(e);
        }
 protected virtual void OnBeforeNavigate2Frame(BrowserBeforeNavigate2EventArgs e)
 {
     if (BeforeNavigate2Frame != null)
         BeforeNavigate2Frame(this, e);
 }
 protected virtual void OnBeforeNavigate2Document(BrowserBeforeNavigate2EventArgs e)
 {
     if (BeforeNavigate2Document != null)
         BeforeNavigate2Document(this, e);
 }