Ejemplo n.º 1
0
 private void bChooseFolder_Click(object sender, EventArgs e)
 {
     if (folderBrowserDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         listBox1.Items.Clear();
         DirectoryInfo di    = new DirectoryInfo(folderBrowserDialog1.SelectedPath);
         FileInfo[]    Files = di.GetFiles("*.cs", SearchOption.AllDirectories);
         foreach (FileInfo fi in Files)
         {
             string msgFile = "Файл: \"" + fi.FullName + "\" ";
             try
             {
                 PointOfInterest ParsedPoints = AspectParser.ParseFile(fi.FullName);
                 int             ptsCount     = PointsCount(ParsedPoints);
                 string          msgResult;
                 if (ParsedPoints == null)
                 {
                     msgResult = "не разобран";
                     msgFile   = "  x   " + msgFile;
                 }
                 else
                 {
                     msgResult = "разобран, сущностей найдено: " + ptsCount.ToString();
                     msgFile   = "      " + msgFile;
                 }
                 listBox1.Items.Add(msgFile + msgResult);
             }
             catch (Exception exc)
             {
                 msgFile = "===== " + msgFile;
                 listBox1.Items.Add(msgFile + "ПАРСЕР УПАЛ " + exc.Message);
                 AspectParser.ReloadParsers();
             }
         }
     }
 }