コード例 #1
0
        public Page1(LCD l)
        {
            lcd = l;
            InitializeComponent();

            update_timer          = new DispatcherTimer();
            update_timer.Interval = new TimeSpan(0, 0, 0, 0, 200);
            update_timer.Tick    += new EventHandler(updateTimer_Tick);

            weatherTimer          = new DispatcherTimer();
            weatherTimer.Interval = new TimeSpan(0, 10, 0);
            weatherTimer.Tick    += new EventHandler(weatherTimer_Tick);

            update_timer.Start();
            weatherTimer.Start();

            yw = new YahooWeather();
            wr = yw.getWeather("Trelleborg", "SE", false);

            if (wr != null)
            {
                imgWeather.Source = setWeatherImage(wr.Condition.Code);
                updateLables();
                setForecast();
            }
        }
コード例 #2
0
 private void weatherTimer_Tick(object sender, EventArgs e)
 {
     wr = yw.getWeather("Trelleborg", "SE", false);
     if (wr != null)
     {
         imgWeather.Source = setWeatherImage(wr.Condition.Code);
         updateLables();
         setForecast();
     }
 }