public static IEnumerable <CustomTimer> CreateTimers(IEnumerable <TimerSettings> timerConfigs, IBalloonTipAdapter balloonTipAdapter) { return(timerConfigs.Select(c => { var timer = new CustomTimer(c); timer.Elapsed += OnTimerTick; timer.BalloonTipAdapter = balloonTipAdapter; return timer; })); }
private static string GenerateTextToDisplay(CustomTimer[] timers) { var aggregated = string.Empty; for (var i = 0; i < timers.Length; i++) { var timer = timers[i]; aggregated += $"Timer #{i + 1} starting @ {timer.Settings.StartTime.ToShortTimeString()}, nudging every {timer.Settings.IntervalRaw}{timer.Settings.IntervalUnit.ToString().ToLower()}\n"; } return aggregated; }
public static IEnumerable<CustomTimer> CreateTimers(IEnumerable<TimerSettings> timerConfigs, IBalloonTipAdapter balloonTipAdapter) { return timerConfigs.Select(c => { var timer = new CustomTimer(c); timer.Elapsed += OnTimerTick; timer.BalloonTipAdapter = balloonTipAdapter; return timer; }); }
private void DisplayInitializationResultToUser(CustomTimer[] timers) { var text = GenerateTextToDisplay(timers); _notify.ShowBalloonTip(8000, "NudgeMe started", text, ToolTipIcon.Info); }