/// <summary> /// Raises the <see cref="E:UriFound"/> event. /// </summary> /// <param name="e">The <see cref="ManagedFusion.Crawler.UriFoundEventArgs"/> instance containing the event data.</param> protected virtual void OnUriFound(UriFoundEventArgs e) { _related.Add(e.Element); if (UriFound != null) UriFound(this, e); }
private static void bot_UriFound(object sender, UriFoundEventArgs e) { Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine(e.Element.RequestedUri); Console.ResetColor(); }
/// <summary> /// Raises the <see cref="E:UriError"/> event. /// </summary> /// <param name="e">The <see cref="ManagedFusion.Crawler.UriFoundEventArgs"/> instance containing the event data.</param> private void OnUriError(UriFoundEventArgs e) { if (UriError != null) UriError(this, e); }
/// <summary> /// Raises the <see cref="E:UriFound"/> event. /// </summary> /// <param name="e">The <see cref="ManagedFusion.Crawler.UriFoundEventArgs"/> instance containing the event data.</param> private void OnUriFound(UriFoundEventArgs e) { if (UriFound != null) UriFound(this, e); }
/// <summary> /// Handles the UriFound event of the handler control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="ManagedFusion.Crawler.UriFoundEventArgs"/> instance containing the event data.</param> private void handler_UriFound(object sender, UriFoundEventArgs e) { lock (_sync) { // make sure the URI hasn't been processed, is processing, or in queued up if (IsProcessingRequired(e.Element)) { _notProcessed.Enqueue(e.Element); OnUriFound(new UriFoundEventArgs(e.Element)); } } }