示例#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, cInfo);

            args.DateTime = cstTime;

            args.LocalDate = cstTime.ToString(new CultureInfo(CultureInfo.Name));

            EventHandler <ThresholdReachedEventArgs> handler = TimeChanged;

            if (handler != null)
            {
                handler(this, args);
            }
        }
示例#2
0
 private void Dtt_TimeChanged(object sender, ThresholdReachedEventArgs e)
 {
     label1.Text = e.LocalDate.ToString();
 }