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

            HistoryCollection = newHistoryCollection;

            GroupWeatherCollection newGroupCollection = _weatherService.GetWeatherBreakdown(newCity);

            GroupHistoryCollection = newGroupCollection;
        }
예제 #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);
        }
예제 #3
0
        public GroupWeatherCollection GetWeatherBreakdown(string citySymbol)
        {
            GroupWeatherCollection items = _groupedHistory[citySymbol];

            return(items);
        }