Inheritance: System.ComponentModel.CancelEventArgs
 protected virtual void OnNavigateError(WebBrowserNavigateErrorEventArgs e)
 {
     if (NavigateError != null)
     {
         this.NavigateError(this, e);
     }
 }
Beispiel #2
0
        /// <summary>
        ///
        /// </summary>
        protected virtual void WebBrowserNavigateErrorHandler(object sender, WebBrowserNavigateErrorEventArgs e)
        {
            // e.StatusCode - Contains error code which we are able to translate this error to text
            // ADAL.Native contains a code for translation.

            if (this.webBrowser.IsDisposed)
            {
                // we cancel all flow in disposed object.
                e.Cancel = true;
                return;
            }

            if (this.webBrowser.ActiveXInstance != e.WebBrowserActiveXInstance)
            {
                // this event came from internal frame, ignore this.
                return;
            }

            if (e.StatusCode >= 300 && e.StatusCode < 400)
            {
                // we could get redirect flows here as well.
                return;
            }

            e.Cancel = true;
            this.StopWebBrowser();
            // in this handler object could be already disposed, so it should be the last method
            this.OnNavigationCanceled(e.StatusCode);
        }
Beispiel #3
0
        /// <summary>
        /// </summary>
        protected virtual void WebBrowserNavigateErrorHandler(object sender, WebBrowserNavigateErrorEventArgs e)
        {
            if (this.DialogResult == DialogResult.OK)
            {
                e.Cancel = true;
                return;
            }

            if (this.webBrowser.IsDisposed)
            {
                // we cancel all flow in disposed object.
                e.Cancel = true;
                return;
            }

            if (this.webBrowser.ActiveXInstance != e.WebBrowserActiveXInstance)
            {
                // this event came from public frame, ignore this.
                return;
            }

            if (e.StatusCode >= 300 && e.StatusCode < 400)
            {
                // we could get redirect flows here as well.
                return;
            }

            e.Cancel = true;
            this.StopWebBrowser();
            // in this handler object could be already disposed, so it should be the last method
            this.OnNavigationCanceled(e.StatusCode);
        }
            public void NavigateError(object pDisp, ref object url, ref object frame, ref object statusCode, ref bool cancel)
            {
                string uriString = ( url == null ) ? "" : ( (string)url );
                string frameString = ( frame == null ) ? "" : ( (string)frame );
                int statusCodeInt = ( statusCode == null )? 0 : ( (int)statusCode );

                WebBrowserNavigateErrorEventArgs e = new WebBrowserNavigateErrorEventArgs( uriString, frameString, statusCodeInt, pDisp );
                this.parent.OnNavigateError( e );
                cancel = e.Cancel;
            }
Beispiel #5
0
            public void NavigateError(object pDisp, ref object url, ref object frame, ref object statusCode, ref bool cancel)
            {
                string uriString     = (url == null) ? "" : ((string)url);
                string frameString   = (frame == null) ? "" : ((string)frame);
                int    statusCodeInt = (statusCode == null)? 0 : ((int)statusCode);

                WebBrowserNavigateErrorEventArgs e = new WebBrowserNavigateErrorEventArgs(uriString, frameString, statusCodeInt, pDisp);

                this.parent.OnNavigateError(e);
                cancel = e.Cancel;
            }
 protected virtual void OnNavigateError(WebBrowserNavigateErrorEventArgs e)
 {
     if (NavigateError != null)
     {
         this.NavigateError(this, e);
     }
 }