/// <summary> /// Processing for the HtmlNavigation event /// </summary> private void OnHtmlNavigation(HtmlNavigationEventArgs args) { if (HtmlNavigation != null) { HtmlNavigation(this, args); } }
/// <summary> /// Event can be used to canel the navigation and open a new window /// If window set to same then nothing happens /// </summary> private void BrowserBeforeNavigate(object sender, WebBrowserNavigatingEventArgs e) { string url = e.Url.ToString(); if (!codeNavigate) { // call the appropriate event processing HtmlNavigationEventArgs navigateArgs = new HtmlNavigationEventArgs(url); OnHtmlNavigation(navigateArgs); // process the event based on the navigation option if (navigateArgs.Cancel) { // cancel the navigation e.Cancel = true; } else if (_navigateWindow == NavigateActionOption.NewWindow) { // cancel the current navigation and load url into a new window e.Cancel = true; this.NavigateToUrl(url, true); } else { // continue with current navigation e.Cancel = false; } } else { // TODO Should ensure the following are no executed for the editor navigation // Scripts // Java // ActiveX Controls // Behaviors // Dialogs // continue with current navigation e.Cancel = false; } }