static private void SortAndPrint(IRecordPrinter<string> printer, IRecordSorter sorter, IEnumerable<Record> records)
 {
     Console.WriteLine("Sorting with {0}", sorter);
     
     foreach (var record in sorter.Sort(records))
     {
         Console.WriteLine(printer.PrintRecord(record));
     }
 }
Beispiel #2
0
 public SearchCondition(int pageNo, int pageSize, IRecordSorter sorter)
     : this(pageNo, pageSize, null, new List <IRecordSorter> {
     sorter
 })
 {
 }
Beispiel #3
0
 /// <summary>
 /// Basic constructor taking a sorter as parameter
 /// </summary>
 /// <param name="recordSorter">Used to sort the data</param>
 public RecordRepository(IRecordSorter recordSorter)
 {
     _recordSorter = recordSorter;
 }
Beispiel #4
0
 /// <summary>
 /// Basic constructor
 /// </summary>
 /// <param name="args">Arguments to the program containing three filenames and optional sort criteria</param>
 /// <param name="recordParser">Service that is used to parse data in files</param>
 /// <param name="recordSorter">Service that is used to sort data</param>
 ///
 /// Modified after submission to use interface types as arguments - accidently used concrete types originally
 /// (same for related fields)
 ///
 public Application(string[] args, IRecordParser recordParser, IRecordSorter recordSorter)
 {
     _args         = args;
     _recordParser = recordParser;
     _recordSorter = recordSorter;
 }