/// <summary> /// Removes an Alarm from the View. /// /// Looks up the given Alarm in the map, and removes its corresponding AlarmUI, /// as well as the map entry itself. /// </summary> /// <param name="alarm">The Alarm that is being removed.</param> private void DeleteAlarm(Alarm alarm) { AlarmUI delAlarmUI = _alarmUIMap[alarm]; Collection.Remove(delAlarmUI); _alarmUIMap.Remove(alarm); }
/// <summary> /// Add a new Alarm to the View. /// /// Creates a new AlarmUI and adds it to the collection (and also to the map which /// allows tracking of the Alarm it is connected to). /// </summary> /// <param name="alarm">The alarm for which an AlarmUI is to be made.</param> private void AddAlarm(Alarm alarm) { AlarmUI alarmUI = new AlarmUI(alarm); _alarmUIMap.Add(alarm, alarmUI); Collection.Add(alarmUI); }