Ejemplo n.º 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;
                }
            }
        }
Ejemplo n.º 2
0
 private void UpdateWeeksWeather(Location location)
 {
     WeeksWeather = WeatherService.FetchWeeksWeather(location);
 }
Ejemplo n.º 3
0
 private void UpdateTomorrowsWeather(Location location)
 {
     TomorrowsWeather = WeatherService.FetchTomorrowsWeather(location);
 }
Ejemplo n.º 4
0
 private void UpdateCurrentWeather(Location location)
 {
     CurrentWeather = WeatherService.FetchCurrentWeather(location);
 }