public void Handle(AlarmItem message) { if (!message.Value) { if (AlarmList.Any(x => x.Address == message.Address)) { var a = AlarmList.Where(x => x.Address == message.Address); foreach (var v in a) { AlarmList.Remove(v); } } } else { AlarmList.Add(message); } }
private List <Alarm> GetIntervalAlarms(int id) { //Returns a list of all alarms that are created as interval alarms SortAlarms(); return(AlarmList.Where(alarm => alarm.PartOfIntervalSet && alarm.IntervalSetId == id).ToList()); }