/// <summary> /// Notifies the <see cref="P:Parent"/> that an error occured during navigation. /// </summary> /// <param name="webBrowser">The top-level or frame <see cref="T:WebBrowser"/> corresponding to the navigation.</param> /// <param name="url">The URL for which navigation failed.</param> /// <param name="frame">The name of the frame in which to display the resource, or <see langword="null" /> if no named frame was targeted for the resource.</param> /// <param name="status">The <see cref="T:WebBrowserNavigateErrorStatus">error status code</see>, if available.</param> /// <param name="cancel"><see langword="true"/> if the navigation should be canceled; otherwise <see langword="false" />.</param> /// <returns><see langword="true"/> to cancel the navigation; otherwise <see langword="false" />.</returns> public abstract bool NavigateError(WebBrowser webBrowser, string url, string frame, WebBrowserNavigateErrorStatus status, bool cancel);
/// <summary> /// Notifies the <see cref="P:Parent"/> that an error occured during navigation. /// </summary> /// <param name="webBrowser">The top-level or frame <see cref="T:WebBrowser"/> corresponding to the navigation.</param> /// <param name="url">The URL for which navigation failed.</param> /// <param name="frame">The name of the frame in which to display the resource, or <see langword="null"/> if no named frame was targeted for the resource.</param> /// <param name="status">The <see cref="T:WebBrowserNavigateErrorStatus">error status code</see>, if available.</param> /// <param name="cancel"><see langword="true"/> if the navigation should be canceled; otherwise <see langword="false"/>.</param> /// <returns> /// <see langword="true"/> to cancel the navigation; otherwise <see langword="false"/>. /// </returns> public override bool NavigateError(WebBrowser webBrowser, string url, string frame, WebBrowserNavigateErrorStatus status, bool cancel) { Uri uri = new Uri(url ?? string.Empty); var e = new WebBrowserNavigateErrorEventArgs(webBrowser, uri, frame, status, cancel); this.Parent.OnNavigateError(e); return(e.Cancel); }
/// <summary> /// Initializes a new instance of the <see cref="WebBrowserNavigateErrorEventArgs"/> class with the <see cref="WebBrowser"/>, <see cref="Url"/>, <see cref="TargetFrameName"/> and <see cref="StatusCode"/> properties set to the given values. /// </summary> /// <param name="webBrowser"> /// The <see cref="WebBrowser"/> that represents the window or frame in which the navigation error occurred. /// </param> /// <param name="url"> /// The URL for which navigation failed. /// </param> /// <param name="targetFrame"> /// The name of the frame or window in which the resource is to be displayed, or a null reference (Nothing in Visual Basic) if no named frame or window was targeted for the resource. /// </param> /// <param name="statusCode"> /// A <see cref="NavigateErrorStatus"/> error status code. /// </param> /// <param name="cancel"> /// <see langword="true"/> to cancel the event; otherwise, <see langword="false"/>. /// </param> public WebBrowserNavigateErrorEventArgs(WebBrowser webBrowser, Uri url, string targetFrame, WebBrowserNavigateErrorStatus statusCode, bool cancel) : base(cancel) { this.WebBrowser = webBrowser; this.Url = url; this.TargetFrameName = targetFrame; this.StatusCode = statusCode; }