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);

#pragma warning disable 618 // WebBrowserNavigateErrorEventArgs is marked obsolete
                WebBrowserNavigateErrorEventArgs e = new WebBrowserNavigateErrorEventArgs(uriString, frameString,
                                                                                          statusCodeInt, pDisp);
#pragma warning restore 618
                parent.OnNavigateError(e);
                cancel = e.Cancel;
            }