public void TickerSymbolChanged(string newCity)
        {
            this.CurrentCity = newCity;
            WeatherCollection newHistoryCollection = _weatherService.GetWeatherHistory(newCity);

            HistoryCollection = newHistoryCollection;

            GroupWeatherCollection newGroupCollection = _weatherService.GetWeatherBreakdown(newCity);

            GroupHistoryCollection = newGroupCollection;
        }
Esempio n. 2
0
        private GroupWeatherCollection GetCurrentGroupHistory(WeatherCollection history)
        {
            var result    = new GroupWeatherCollection();
            var tempQuery =
                from hour in history
                group hour by hour.Value into newGroup
                orderby newGroup.Key
                select newGroup;

            foreach (var g in tempQuery)
            {
                result.Add(new WeatherGroupItem {
                    Counts      = g.Count(),
                    Temperature = g.Key
                });
            }

            return(result);
        }
Esempio n. 3
0
        public GroupWeatherCollection GetWeatherBreakdown(string citySymbol)
        {
            GroupWeatherCollection items = _groupedHistory[citySymbol];

            return(items);
        }