Ejemplo n.º 1
0
        private void SearchIcon_Click(object sender, EventArgs e)
        {
            if (maporweather == false)
            {
                SecondGroupBox.Hide();
                ThirdGroupBox.Hide();
                FourthGroupBox.Hide();
                FifthGroupBox.Hide();
                SixthGroupBox.Hide();

                if (WeatherInformation(Search.Text).Result.name != "")
                {
                    Boxes(Search.Text, FirstGroupBox, FirstIconBox, tempmax, tempmin, Wind1);
                    lon = WeatherInformation(FirstGroupBox.Text).Result.Rlon;
                    lat = WeatherInformation(FirstGroupBox.Text).Result.Rlat;
                }
                else
                {
                    FirstGroupBox.Hide();
                }


                YN = true;
            }
            else
            {
                using (StreamReader st = new StreamReader("City1.txt"))
                {
                    string text = st.ReadToEnd();
                    if (WeatherInformation(text).Result.name != "")
                    {
                        Boxes(text, FirstGroupBox, FirstIconBox, tempmax, tempmin, Wind1);
                        lon = WeatherInformation(Search.Text).Result.Rlon;
                        lat = WeatherInformation(Search.Text).Result.Rlat;
                    }
                    else
                    {
                    }
                }

                YN = true;
            }
        }
Ejemplo n.º 2
0
        private void WeatherTimer_Tick(object sender, EventArgs e)
        {
            if (Search.Text == "" && YN == true)
            {
                FirstGroupBox.Show();
                SecondGroupBox.Show();
                ThirdGroupBox.Show();
                FourthGroupBox.Show();
                FifthGroupBox.Show();
                SixthGroupBox.Show();

                using (StreamReader st = new StreamReader("City1.txt"))
                {
                    string text = st.ReadToEnd();
                    Boxes(text, FirstGroupBox, FirstIconBox, tempmax, tempmin, Wind1);
                }

                YN = false;
            }
        }