Beispiel #1
0
        private void getTime(object sender, EventArgs e)
        {
            timeUtc = DateTime.UtcNow;
            DateTime cstTime = TimeZoneInfo.ConvertTimeFromUtc(timeUtc, this.TimeZone);


            ThresholdReachedEventArgs args = new ThresholdReachedEventArgs();

            args.Time = cstTime.ToString(TimeFormat, CultureInfo.InvariantCulture);


            EventHandler <ThresholdReachedEventArgs> handler = TimeChanged;

            if (handler != null)
            {
                handler(this, args);
            }
        }
Beispiel #2
0
 private void ClockTimer1_TimeChanged(object sender, ThresholdReachedEventArgs e)
 {
     label1.Text = e.Time.ToString();
 }