void GrepFinishedFile(object sender, GrepFinishedFileEventArgs e) { SetCursor(this, Cursors.WaitCursor); lock (_updatelock) { if (e.MatchingLineCount > 0) { _totalLineMatches += e.MatchingLineCount; } var index = GetListBoxItemIndex <GrepResult>(lbResults, x => x.FilePath == e.FilePath); RefreshListBoxItem <GrepResult>(lbResults, index); } }
static void GrepFinishedFile(object sender, GrepFinishedFileEventArgs e) { lock (_updatelock) { var line = string.Empty; if (e.MatchingLineCount > 0) { if (_countLines) { line += string.Format(" {0} Matching Line(s)", e.MatchingLineCount); } _totalLineMatches += e.MatchingLineCount; } if (!string.IsNullOrEmpty(line)) { Console.WriteLine(line); } } }