using System; using System.Collections.Generic; using System.Linq; using System.Runtime; using System.Text; using System.Threading.Tasks; namespace NightScout { public class MultiAlerter : IAlerter { public List Alerters { get; set; } public MultiAlerter(IEnumerable alerters) { Alerters = new List(alerters); } public void StartAlert() { Alerters.ForEach(a => { try { a.StartAlert(); } catch (Exception ex) { Console.WriteLine(ex); } }); } public void StartUrgentAlert() { Alerters.ForEach(a => { try { a.StartUrgentAlert(); } catch (Exception ex) { Console.WriteLine(ex); } }); } public void StartStaleDataAlert() { Alerters.ForEach(a => { try { a.StartStaleDataAlert(); } catch (Exception ex) { Console.WriteLine(ex); } }); } public void StopAlerts() { Alerters.ForEach(a => { try { a.StopAlerts(); } catch (Exception ex) { Console.WriteLine(ex); } }); } } }