示例#1
0
 private void Timer_Tick(object sender, object e)
 {
     Now = Now.AddSeconds(1);
     if (DateTimeChanged != null)
     {
         var arg = new DateTimeChangedEventArgs();
         arg.CurrentTime = Now;
         DateTimeChanged(this, arg);
     }
 }
示例#2
0
 private void Timer_Tick(object sender, object e)
 {
     Now = Now.AddSeconds(1);
     if (DateTimeChanged != null)
     {
         var arg = new DateTimeChangedEventArgs();
         arg.CurrentTime = Now;
         DateTimeChanged(this, arg);
     }
 }
示例#3
0
        private async void Internet_InternetConnectionChanged(object sender, InternetConnectionChangedEventArgs args)
        {
            if (args.IsConnected)
            {
                Now = (DateTime) await GetNistTime();

                if (DateTimeChanged != null)
                {
                    var arg = new DateTimeChangedEventArgs();
                    arg.CurrentTime = Now;
                    DateTimeChanged(this, arg);
                }
            }
        }
示例#4
0
 private async void Internet_InternetConnectionChanged(object sender, InternetConnectionChangedEventArgs args)
 {
     if (args.IsConnected)
     {
         Now = (DateTime) await GetNistTime();
         if (DateTimeChanged != null)
         {
             var arg = new DateTimeChangedEventArgs();
             arg.CurrentTime = Now;
             DateTimeChanged(this, arg);
         }
             
     }
 }