public void Init() { cbxProvice.DataSource = WeatherHelper.GetSupportProvince().ToList(); cbxProvice.SelectedIndex = 0; cbxCity.DataSource = WeatherHelper.GetSupportCity(cbxProvice.SelectedValue.ToString()); cbxCity.SelectedIndex = 0; }
//protected override void OnStart(string[] args) public void OnStart() { _City = WeatherHelper.GetSupportCity("ALL"); int _interval = 5000; _timer.Interval = _interval; _timer.AutoReset = true; _timer.Enabled = true; _timer.Elapsed += new System.Timers.ElapsedEventHandler(ActionRun); }
private void cbxProvice_SelectedIndexChanged(object sender, EventArgs e) { cbxCity.DataSource = WeatherHelper.GetSupportCity(cbxProvice.SelectedValue.ToString()); cbxCity.SelectedIndex = 0; }