コード例 #1
0
ファイル: FormWinGrep.cs プロジェクト: pinndulum/GrepSearch
 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
ファイル: Program.cs プロジェクト: pinndulum/GrepSearch
 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);
         }
     }
 }