コード例 #1
0
        //put this in a more logical location, verify that other methods are
        //grouped reasonably, as well
        private void AlarmCLB_ItemCheck(Object sender, ItemCheckEventArgs e)
        {
            if (!activeAlarms.ElementAt(e.Index).Running&&
                activeAlarms.ElementAt(e.Index).IsPast())
            {
                MessageBox.Show("Alarm cannot be in the past!", "Alarm Already Passed",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                AlarmCLB.SetItemCheckState(e.Index, CheckState.Unchecked);
                return;
            }

            activeAlarms.ElementAt(e.Index).Running =
                activeAlarms.ElementAt(e.Index).ToggleRunning();
            if (activeAlarms.ElementAt(e.Index).Running)
            {
                if (!tmrGreenwichAtomic.Enabled)
                {
                    if (Debug.tickDebugging)
                    {
                        Debug.ShowDbgOut("Starting Greenwich Atomic");
                    }

                    tmrGreenwichAtomic.Enabled = true;
                    tmrGreenwichAtomic.Start();
                }
            }
        }
コード例 #2
0
 private void TimerSelectedChange(object sender, EventArgs e)
 {
     if ((AlarmCLB.SelectedIndex != -1) ||
         (ReminderCLB.SelectedIndex != -1))
     {
         AlarmCLB.ClearSelected(); ReminderCLB.ClearSelected();
     }
 }