Exemplo n.º 1
0
        /// <summary>
        /// Adds a new alarm and timer from user input
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void uxAddButton_Click(object sender, EventArgs e)
        {
            AddOrEditAlarmDialog addAlarmDialog = new AddOrEditAlarmDialog();

            if (addAlarmDialog.ShowDialog() == DialogResult.OK)
            {
                Alarm alarm = new Alarm(addAlarmDialog.Time, addAlarmDialog.On);
                AddAlarm(alarm);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Event handler for editing an alarm
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void uxEditButton_Click(object sender, EventArgs e)
        {
            Alarm alarm = (Alarm)uxAlarmList.SelectedItem;
            AddOrEditAlarmDialog addAlarmDialog = new AddOrEditAlarmDialog();

            if (addAlarmDialog.ShowDialog() == DialogResult.OK)
            {
                alarm.Edit(addAlarmDialog.Time, addAlarmDialog.On);
            }
        }