Пример #1
0
        private void TimerElapsed()
        {
            FormattedTime = timerUtil.GetFormattedLocationTime(DateTime.UtcNow);

            intervalTimer.Interval = timerUtil.GetMinuteUpdateInterval(DateTime.Now);
            intervalTimer.Start();
        }
Пример #2
0
        public Timer(ITimerUtility timerUtil)
        {
            this.timerUtil = timerUtil;

            FormattedTime = timerUtil.GetFormattedLocationTime(DateTime.UtcNow);

            intervalTimer = new DispatcherTimer(
                timerUtil.GetMinuteUpdateInterval(DateTime.Now),
                DispatcherPriority.Normal,
                delegate { TimerElapsed(); },
                Dispatcher.CurrentDispatcher);
        }