Пример #1
0
 private void TanjiSchedulerEdit_FormClosed(object sender, FormClosedEventArgs e)
 {
     if (_wasRunning)
     {
         _schedule.Start();
     }
 }
Пример #2
0
        protected override void OnItemChecked(ItemCheckedEventArgs e)
        {
            if (!_schedules.ContainsKey(e.Item))
            {
                return;
            }

            HSchedule schedule = _schedules[e.Item];

            e.Item.SubItems[4].Text = e.Item.Checked ? "Running" : "Stopped";

            if (e.Item.Checked)
            {
                schedule.Start();
            }
            else if (schedule.IsRunning)
            {
                schedule.Stop();
            }

            base.OnItemChecked(e);
        }