Пример #1
0
        private static void OnTick(object sender, ElapsedEventArgs e)
        {
            Time = new TimeInfo();

            if (Tick != null)
                Tick(null, EventArgs.Empty);
        }
Пример #2
0
        static TimeUpdater()
        {
            s_timer = new Timer();
            s_timer.AutoReset = true;
            s_timer.Interval = 1000;
            s_timer.Elapsed += new ElapsedEventHandler(OnTick);

            Time = new TimeInfo();
        }
Пример #3
0
 private static void OnTick(object sender, ElapsedEventArgs e)
 {
     Time = new TimeInfo();
     Tick?.Invoke(null, EventArgs.Empty);
 }
Пример #4
0
        private void UpdateText()
        {
            TimeInfo info = new TimeInfo();

            StringBuilder sb = new StringBuilder();
            sb.AppendFormat("{0}{1}{2}", info.Hours, info.TimeSeparator, info.Minutes);
            sb.AppendLine();
            sb.AppendLine(info.Day);
            sb.Append(info.Date);

            if (m_chkUpperCase.Checked)
                m_lblPreview.Text = sb.ToString().ToUpper();
            else
                m_lblPreview.Text = sb.ToString();
        }