Esempio n. 1
0
    public override IEnumerable<string> Process()
    {
      var properties = SampleUtils.ReadPropertiesFromFile(options.PropertyFile);
      var format = new SampleItemTextWriter(properties);

      List<SampleItem> total = new List<SampleItem>();
      foreach (var subdir in options.SampleDirectories())
      {
        Progress.SetMessage("processing " + subdir + " ...");

        var dirname = Path.GetFileName(subdir);
        var sifile = Path.Combine(subdir, dirname + ".siformat");
        var parser = new SampleItemParser(sifile);

        var flist = parser.ParseDataset(subdir);
        var sampleFile = Path.ChangeExtension(sifile, ".sample");
        format.WriteToFile(sampleFile, flist.Values.ToList());

        total.AddRange(from l in flist
                       where AcceptGsmName(l.Key)
                       select l.Value);
      }

      format.WriteToFile(options.OutputFile, total);

      var htmlFile = Path.ChangeExtension(options.OutputFile, ".html");
      new SampleItemHtmlWriter(properties).WriteToFile(htmlFile, total);

      var excelFile = Path.ChangeExtension(htmlFile, ".xls");
      new SampleItemExcelWriter(properties).WriteToFile(excelFile, total);

      return new string[] { options.OutputFile, htmlFile, excelFile };
    }
Esempio n. 2
0
        private void btnTest_Click(object sender, EventArgs e)
        {
            if (dlgOpenDirectory.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                FormToDefinition();

                var parser = new SampleItemParser(items);
                var map    = parser.ParseDataset(dlgOpenDirectory.SelectedPath);
                var lst    = (from v in map.Values
                              orderby v.Sample
                              select v).ToList();

                var form = new SampleInformationForm();
                form.SetColumns(properties);
                form.SetDataset(Path.GetFileName(dlgOpenDirectory.SelectedPath));
                form.SetDataSource(lst);
                form.ShowDialog();
            }
        }
Esempio n. 3
0
        public override IEnumerable <string> Process()
        {
            var properties = SampleUtils.ReadPropertiesFromFile(options.PropertyFile);
            var format     = new SampleItemTextWriter(properties);

            List <SampleItem> total = new List <SampleItem>();

            foreach (var subdir in options.SampleDirectories())
            {
                Progress.SetMessage("processing " + subdir + " ...");

                var dirname = Path.GetFileName(subdir);
                var sifile  = Path.Combine(subdir, dirname + ".siformat");
                var parser  = new SampleItemParser(sifile);

                var flist      = parser.ParseDataset(subdir);
                var sampleFile = Path.ChangeExtension(sifile, ".sample");
                format.WriteToFile(sampleFile, flist.Values.ToList());

                total.AddRange(from l in flist
                               where AcceptGsmName(l.Key)
                               select l.Value);
            }

            format.WriteToFile(options.OutputFile, total);

            var htmlFile = Path.ChangeExtension(options.OutputFile, ".html");

            new SampleItemHtmlWriter(properties).WriteToFile(htmlFile, total);

            var excelFile = Path.ChangeExtension(htmlFile, ".xls");

            new SampleItemExcelWriter(properties).WriteToFile(excelFile, total);

            return(new string[] { options.OutputFile, htmlFile, excelFile });
        }
    private void btnTest_Click(object sender, EventArgs e)
    {
      if (dlgOpenDirectory.ShowDialog() == System.Windows.Forms.DialogResult.OK)
      {
        FormToDefinition();

        var parser = new SampleItemParser(items);
        var map = parser.ParseDataset(dlgOpenDirectory.SelectedPath);
        var lst = (from v in map.Values
                   orderby v.Sample
                   select v).ToList();

        var form = new SampleInformationForm();
        form.SetColumns(properties);
        form.SetDataset(Path.GetFileName(dlgOpenDirectory.SelectedPath));
        form.SetDataSource(lst);
        form.ShowDialog();
      }
    }