Example #1
0
        public void HandleVoiceCommand(string command, string timeFrame, string city)
        {
            Location location;

            if (city.Length != 0)
            {
                location = LocationService.GetLocationFromCity(city);
            }
            else
            {
                location = LocationService.GetDefaultLocation();
            }
            if (WeatherCommands.CMD_SHOW.Equals(command))
            {
                Debug.Write("Show ");
                switch (timeFrame)
                {
                case WeatherCommands.TIME_TODAY:
                    WeatherCurrent weather = WeatherService.FetchCurrentWeather(location);
                    break;

                case WeatherCommands.TIME_TOMORROW:
                    Debug.WriteLine("TIME_TOMORROW: " + timeFrame);
                    break;

                case WeatherCommands.TIME_WEEK:
                    Debug.WriteLine("TIME_WEEK: " + timeFrame);
                    break;
                }
            }
            else if (WeatherCommands.CMD_HIDE.Equals(command))
            {
                Debug.Write("Hide ");
                switch (timeFrame)
                {
                case WeatherCommands.TIME_TODAY:
                    Debug.WriteLine("TIME_TODAY: " + timeFrame);
                    break;

                case WeatherCommands.TIME_TOMORROW:
                    Debug.WriteLine("TIME_TOMORROW: " + timeFrame);
                    break;

                case WeatherCommands.TIME_WEEK:
                    Debug.WriteLine("TIME_WEEK: " + timeFrame);
                    break;
                }
            }
        }
Example #2
0
 private void UpdateCurrentWeather(Location location)
 {
     CurrentWeather = WeatherService.FetchCurrentWeather(location);
 }