Exemple #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);
     }
 }
Exemple #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);
     }
 }
Exemple #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);
                }
            }
        }
Exemple #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);
         }
             
     }
 }