private void _crawler_ScanComplete(object sender, RunWorkerCompletedEventArgs args) { try { CrawlProgressEventArgs stats = args.Result as CrawlProgressEventArgs; if (stats == null) { SystemSounds.Beep.Play(); toolStripStatusLabel1.Text = "Scan completed!"; } else if (stats.WasCanceled) { toolStripStatusLabel1.Text = "Scan canceled!"; } else { SystemSounds.Beep.Play(); toolStripStatusLabel1.Text = string.Format("Scan completed! {0} directories processed, {1} files processed, {2} sections found", stats.DirectoriesProcessed, stats.FilesProcessed, stats.SectionsFound); } } catch { // fail gracefully } }
private void _crawler_ProgressUpdated(object sender, CrawlProgressEventArgs args) { try { toolStripStatusLabel1.Text = string.Format("Scan progress: {0} directories processed, {1} files processed, {2} sections found", args.DirectoriesProcessed, args.FilesProcessed, args.SectionsFound); Application.DoEvents(); } catch { // fail gracefully } }