GetWeather() 공개 정적인 메소드

public static GetWeather ( string zipCode ) : Task
zipCode string
리턴 Task
예제 #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Main);

            Button button = FindViewById <Button>(Resource.Id.GetWeatherButton);

            button.Click += delegate
            {
                EditText ZipCodeEditText = FindViewById <EditText>(Resource.Id.ZipCodeEdit);

                Weather weather = Core.GetWeather(ZipCodeEditText.Text).Result;

                if (weather != null)
                {
                    FindViewById <TextView>(Resource.Id.ResultsTitle).Text   = weather.Title;
                    FindViewById <TextView>(Resource.Id.TempText).Text       = weather.Temperature;
                    FindViewById <TextView>(Resource.Id.WindText).Text       = weather.Wind;
                    FindViewById <TextView>(Resource.Id.VisibilityText).Text = weather.Visibility;
                    FindViewById <TextView>(Resource.Id.HumidityText).Text   = weather.Humidity;
                    FindViewById <TextView>(Resource.Id.SunriseText).Text    = weather.Sunrise;
                    FindViewById <TextView>(Resource.Id.SunsetText).Text     = weather.Sunset;

                    button.Text = "Search Again";
                }
                else
                {
                    FindViewById <TextView>(Resource.Id.ResultsTitle).Text = "Couldn't find any results";
                }
            };
        }
예제 #2
0
        private async void GetWeatherButton_Clicked(object sender, EventArgs e)
        {
            var weather = await Core.GetWeather(ZipCodeEntry.Text);

            BindingContext     = weather;
            GetWeatherBtn.Text = "Search Again";
        }
예제 #3
0
 private async void GetWeatherBtn_Clicked(object sender, EventArgs e)
 {
     if (!String.IsNullOrEmpty(zipCodeEntry.Text))
     {
         Weather weather = await Core.GetWeather(zipCodeEntry.Text); this.BindingContext = weather;
         getWeatherBtn.Text = "Search Again";
     }
 }
예제 #4
0
        private async void GetWeatherBtn_Clicked(object sender, EventArgs e)
        {
            if (zipCodeEntry.Text != null)
            {
                Weather weather = await Core.GetWeather(zipCodeEntry.Text);

                this.BindingContext = weather;
                getWeatherBtn.Text  = "search again";
            }
        }
예제 #5
0
        private async void GetWeatherBtn_Clicked(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(zipCodeEntry.Text))
            {
                Weather weather = await Core.GetWeather(zipCodeEntry.Text, (string)unitOfMeasure.SelectedItem);

                if (weather != null)
                {
                    this.BindingContext = weather;
                    getWeatherBtn.Text  = "Search Again";
                }
            }
        }
예제 #6
0
        private async void GetWeatherBtn_Clicked(object sender, EventArgs e) // Statisk klasse, der overskriver eksisterende vejrdata og indsætter nye
        {
            if (!String.IsNullOrEmpty(zipCodeEntry.Text))
            {
                Weather weather = await Core.GetWeather(zipCodeEntry.Text);

                if (weather != null)
                {
                    this.BindingContext = weather;
                    getWeatherBtn.Text  = "Search Again";
                }
            }
        }
예제 #7
0
        private async void GetWeatherBtn_Clicked(object sender, EventArgs e)
        {
            //if (!String.IsNullOrEmpty(zipCodeEntry.Text))
            if (!String.IsNullOrEmpty(byNavnEntry.Text))
            {
                //Weather weather = await Core.GetWeather(zipCodeEntry.Text);
                Weather weather = await Core.GetWeather(byNavnEntry.Text);

                if (weather != null)
                {
                    this.BindingContext = weather;
                    getWeatherBtn.Text  = "Søg igen";
                }
            }
        }
예제 #8
0
        private async void Button_Click(object sender, EventArgs e)
        {
            EditText zipCodeEntry = FindViewById <EditText>(Resource.Id.zipCodeEntry);

            if (!String.IsNullOrEmpty(zipCodeEntry.Text))
            {
                Weather weather = await Core.GetWeather(zipCodeEntry.Text);

                FindViewById <TextView>(Resource.Id.locationText).Text   = weather.Title;
                FindViewById <TextView>(Resource.Id.tempText).Text       = weather.Temperature;
                FindViewById <TextView>(Resource.Id.windText).Text       = weather.Wind;
                FindViewById <TextView>(Resource.Id.visibilityText).Text = weather.Visibility;
                FindViewById <TextView>(Resource.Id.humidityText).Text   = weather.Humidity;
                FindViewById <TextView>(Resource.Id.sunriseText).Text    = weather.Sunrise;
                FindViewById <TextView>(Resource.Id.sunsetText).Text     = weather.Sunset;
            }
        }
        private async void Button_Clicked(object sender, EventArgs e)
        {
            UserDialogs.Instance.ShowLoading("Loading Data...");
            String city = search.Text;

            Weather result = await Core.GetWeather(city);


            place.Text       = result.Title;
            description.Text = result.description;
            temp.Text        = result.Tempurature;
            humidity.Text    = result.Humidity + "%";
            wind.Text        = result.Wind + "m/h";



            sunrize.Text = result.Sunrize;
            sunset.Text  = result.Sunset;

            UserDialogs.Instance.HideLoading();
        }
예제 #10
0
        //int count = 1;

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            Button button = FindViewById <Button>(Resource.Id.GetWeatherButton);

            button.Click += delegate
            {
                EditText ZipCodeEditText = FindViewById <EditText>(Resource.Id.ZipCodeEdit);

                Weather weather = Core.GetWeather(ZipCodeEditText.Text).Result;

                if (weather != null)
                {
                    FindViewById <TextView>(Resource.Id.ResultsTitle).Text   = weather.Title;
                    FindViewById <TextView>(Resource.Id.TempText).Text       = weather.Temperature;
                    FindViewById <TextView>(Resource.Id.WindText).Text       = weather.Wind;
                    FindViewById <TextView>(Resource.Id.VisibilityText).Text = weather.Visibility;
                    FindViewById <TextView>(Resource.Id.HumidityText).Text   = weather.Humidity;
                    FindViewById <TextView>(Resource.Id.SunriseText).Text    = weather.Sunrise;
                    FindViewById <TextView>(Resource.Id.SunsetText).Text     = weather.Sunset;

                    button.Text = "Search Again";
                }
                else
                {
                    FindViewById <TextView>(Resource.Id.ResultsTitle).Text = "Couldn't find any results";
                }
            };

            // Get our button from the layout resource,
            // and attach an event to it
            //Button button = FindViewById<Button>(Resource.Id.MyButton);

            //button.Click += delegate { button.Text = string.Format("{0} clicks!", count++); };
        }
예제 #11
0
        private async void GetWeatherBtn_Clicked(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(cityEntry.Text) && dateXML.Date.Day > 0)
            {
                Weather weather = await Core.GetWeather(cityEntry.Text, dateXML.Date);

                if (weather != null)
                {
                    this.BindingContext = weather;
                    w = weather;
                    canvas.InvalidateSurface();
                    getWeatherBtn.Text = "Search Again";
                }
                else
                {
                    this.BindingContext = weather;
                    getWeatherBtn.Text  = "Error";
                }
            }
            else
            {
                getWeatherBtn.Text = "Fill in all fields";
            }
        }
예제 #12
0
        private async void GetWeatherBtn_Clicked(object sender, EventArgs e)
        {
            Weather weather = await Core.GetWeather("27203");

            getWeatherBtn.Text = weather.Title;
        }
예제 #13
0
        private async void Weather_Clicked(object sender, EventArgs e)
        {
            Weather weatherData = await Core.GetWeather(_zipCodeEntry.Text);

            BindingContext = weatherData;
        }
예제 #14
0
파일: App.cs 프로젝트: skbabu/WeatherApp
        protected override void OnStart()
        {
         if (!String.IsNullOrEmpty (FavoriteCityLabel.Text))
            {
		    Weather weather = await Core.GetWeather						(FavoriteCityLabel.Text);
            }