private static void OnTick(object sender, ElapsedEventArgs e) { Time = new TimeInfo(); if (Tick != null) Tick(null, EventArgs.Empty); }
static TimeUpdater() { s_timer = new Timer(); s_timer.AutoReset = true; s_timer.Interval = 1000; s_timer.Elapsed += new ElapsedEventHandler(OnTick); Time = new TimeInfo(); }
private static void OnTick(object sender, ElapsedEventArgs e) { Time = new TimeInfo(); Tick?.Invoke(null, EventArgs.Empty); }
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(); }