コード例 #1
0
 private Func <LogGrouping, MainLogSection> flatten(GroupingStrategy groupingStrategy, int dayInLog, int daysInThePast)
 {
     return(day =>
     {
         var items = groupingStrategy(day);
         var title = DateToTitleString.Convert(day.Key, timeService.CurrentDateTime);
         var duration = totalTrackedTime(items).ToFormattedString(durationFormat);
         return new MainLogSection(
             new DaySummaryViewModel(day.Key, title, duration),
             flattenGroups(items, dayInLog, daysInThePast)
             );
     });
 }
コード例 #2
0
 private Func <LogGrouping, MainLogSection> flatten(
     Func <IEnumerable <IThreadSafeTimeEntry>, IEnumerable <IThreadSafeTimeEntry[]> > groupingStrategy)
 {
     return(day =>
     {
         var items = groupingStrategy(day);
         var title = DateToTitleString.Convert(day.Key, timeService.CurrentDateTime);
         var duration = totalTrackedTime(items).ToFormattedString(durationFormat);
         return new MainLogSection(
             new DaySummaryViewModel(day.Key, title, duration),
             flattenGroups(items)
             );
     });
 }