Exemplo n.º 1
0
        private async Task <DialogTurnResult> WeatherResultStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
        {
            var Intent  = stepContext.Result.ToString();
            var weather = await WeatherApi.GetWeather(Intent);

            var weatherOk = weather.ToString();
            await stepContext.Context.SendActivityAsync(weatherOk);


            return(await stepContext.EndDialogAsync(null, cancellationToken));
        }
Exemplo n.º 2
0
        async void GetWeather(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(cityIdEntry.Text))
            {
                Weather weather = await WeatherApi.GetWeather(cityIdEntry.Text);

                if (weather != null)
                {
                    this.BindingContext = weather;
                    getWeatherBtn.Text  = "Search Again";
                }
            }
        }
Exemplo n.º 3
0
        private async void loadWeather()
        {
            WeatherApi  weatherApi = new WeatherApi();
            WeatherInfo weather;
            var         city = settingsMgr.getStringSettings(SettingKey.CITY_NAME_KEY);

            if (city != null)
            {
                weather = await weatherApi.GetWeatherByCity(city);
            }
            else
            {
                weather = await weatherApi.GetWeather("30047");
            }

            if (weather != null)
            {
                weatherLbl.Text = weather.WeatherDisplayText;
                BitmapImage bitmap = new BitmapImage(new Uri(base.BaseUri, @"/Assets/" + weather.IconString + ".png"));
                weatherIcon.Source = bitmap;

                // "/Assets/" + weather.IconString + ".png";
            }
        }
 public void DefineBackgroundWeather(WeatherApi api)
 {
     // Define which group images to use
     weather = api.GetWeather();
 }
        public string Get()
        {
            weatherApi.GetWeather();

            return("OK");
        }