Пример #1
0
        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;
            }));
        }
Пример #2
0
        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;
        }
Пример #3
0
        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;
            });
        }
Пример #4
0
        private void DisplayInitializationResultToUser(CustomTimer[] timers)
        {
            var text = GenerateTextToDisplay(timers);

            _notify.ShowBalloonTip(8000, "NudgeMe started", text, ToolTipIcon.Info);
        }