示例#1
0
 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);
     }
 }
示例#2
0
 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);
         }
     }
 }