Esempio n. 1
0
        public override void Save(FitCollection input)
        {
            IEnumerable<string> concatenatedFits = input.Fittings.SelectMany(x => x.RawFit);
            string newfilename = Path;

            #if DEBUG
            //var T = new Regex(@".*?<Name>([^\\]*)\.cfg");
            //var MatchResult = T.Match(Path);
            //var r = MatchResult.Groups["Name"].Value;

            //newfilename = newfilename.Replace(r + ".cfg", r + " - Sorted.cfg");
            #endif
            Console.WriteLine(String.Format("Sorted File : {0}", newfilename));

            File.WriteAllLines(newfilename, concatenatedFits);
        }
Esempio n. 2
0
        private FitCollection SplitIntoFittings(string[] input)
        {
            var fits = new FitCollection();

            int startIndex = 0;

            for (int stopIndex = 1; stopIndex < input.Length; stopIndex++)
            {
                if (Regex.IsMatch(input[stopIndex], @"\[.*\]"))
                {
                    fits.Fittings.Add(new Fitting(input.Skip(startIndex).Take(stopIndex - startIndex).ToArray()));
                    startIndex = stopIndex;
                }
            }
            fits.Fittings.Add(new Fitting(input.Skip(startIndex).ToArray()));

            return fits;
        }
 public override void Save(FitCollection input)
 {
     input.Fittings.ForEach(x => Console.WriteLine(x.Name));
 }
Esempio n. 4
0
 private void ProcessFits(FitCollection fits)
 {
     fits.Fittings.Sort(new AlphaFitComparer());
 }
Esempio n. 5
0
 private void OutputFits(FitCollection fits)
 {
     Repository.Save(fits);
 }