Exemplo n.º 1
0
        /// <summary>
        /// Search for a city from weather.com
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void searchButton_Click(object sender, EventArgs e)
        {
            SearchCityForm searchForm = new SearchCityForm();

            // Show dialog
            if (searchForm.ShowDialog(this) == DialogResult.OK)
            {
                // Fetch selected cities
                ArrayList cities = searchForm.SelectedCities;
                foreach (WeatherChannel.City city in cities)
                {
                    citiesListView.Items.Add(
                        new ListViewItem(new string[]
                    {
                        city.Name, city.Id, searchForm.SatteliteImage, searchForm.TemperatureImage,
                        searchForm.UVIndexImage, searchForm.WindsImage, searchForm.HumidityImage,
                        searchForm.PrecipitationImage
                    }));
                }
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Search for a city from weather.com
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void searchButton_Click(object sender, EventArgs e)
 {
   SearchCityForm searchForm = new SearchCityForm();
   // Show dialog
   if (searchForm.ShowDialog(this) == DialogResult.OK)
   {
     // Fetch selected cities
     ArrayList cities = searchForm.SelectedCities;
     foreach (WeatherChannel.City city in cities)
     {
       citiesListView.Items.Add(
         new ListViewItem(new string[]
                            {
                              city.Name, city.Id, searchForm.SatteliteImage, searchForm.TemperatureImage,
                              searchForm.UVIndexImage, searchForm.WindsImage, searchForm.HumidityImage,
                              searchForm.PrecipitationImage
                            }));
     }
   }
 }