/// <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); } }
/// <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); } }