Exemplo n.º 1
0
 private Func <LiveCharts.Defaults.ObservableValue, int, object> ShouldBeWeekendColoured(Brush weekendBrush)
 {
     return((item, index) =>
     {
         if (index > MatchHistory.Count() - 1)
         {
             return null;
         }
         return IsWeekendDay(MatchHistory.ElementAt(index).Date) ? weekendBrush : null;
     });
 }
Exemplo n.º 2
0
        private void GenerateStatistics()
        {
            string[] maps = Maps.All.Where(m => m != "N/A").ToArray();

            TotalPlayed   = MatchHistory.Count();
            TotalWon      = MatchHistory.Wins();
            TotalDrawn    = MatchHistory.Draws();
            TotalLost     = MatchHistory.Losses();
            TotalWithMaps = MatchHistory.Count(r => r.Map != "N/A");
            Stats         = new ObservableCollection <MapStatistics>(
                from map in maps
                let matches = MatchHistory.Where(match => match.Map == map)
                              orderby matches.Wins() descending, matches.Count() descending
                select new MapStatistics()
            {
                Map         = map,
                TotalPlayed = matches.Count(),
                TotalWon    = matches.Wins(),
                TotalDrawn  = matches.Draws(),
                TotalLost   = matches.Losses()
            }
                );
        }