示例#1
0
        private void OnClockTicked(object sender, TimeChangeEventArgs e)
        {
            var clockTicked = ClockTicked;

            if (clockTicked != null)
            {
                clockTicked(sender, e);
            }
        }
示例#2
0
        public void Run()
        {
            for (; ;)
            {
                Thread.Sleep(1000);

                var dt = DateTime.Now;

                if (dt.Second != _second)
                {
                    var args = new TimeChangeEventArgs { Hour = dt.Hour, Minute = dt.Minute, Second = dt.Second };

                    OnClockTicked(this, args);
                }

                _hour = dt.Hour;
                _minute = dt.Minute;
                _second = dt.Second;
            }
        }
示例#3
0
 private void FillContextWithTime(object sender, TimeChangeEventArgs e)
 {
     Dispatcher.CurrentDispatcher.Invoke((Action)delegate() { this.DisplayTimeUsingNormalThread = new TimeDetails { Hour = e.Hour, Minute = e.Minute, Second = e.Second }.ToString(); });
 }