コード例 #1
0
 private void OnChangedLocationData(object source, FileSystemEventArgs e)
 {
     try
     {
         builder.LoadLocationData();
         Logger.Debug("updated location data file");
     }
     catch (Exception ex)
     {
         Logger.Debug(ex, "location data file locked, cannot load");
     }
 }
コード例 #2
0
 private void OnChangedLocationData(object source, FileSystemEventArgs e)
 {
     if (!AdmConfigBuilder.IsFileLocked(new FileInfo(configBuilder.LocationDataPath)))
     {
         try
         {
             configBuilder.LoadLocationData();
             Logger.Debug("updated location data file");
         }
         catch (Exception ex)
         {
             Logger.Debug(ex, "location data file locked, cannot load");
         }
     }
 }
コード例 #3
0
 private void OnChangedLocationData(object source, FileSystemEventArgs e)
 {
     if (DateTime.Now.Subtract(lastTimeLocationConfigChanged).TotalMilliseconds < 20)
     {
         return;
     }
     lastTimeLocationConfigChanged = DateTime.Now;
     if (!AdmConfigBuilder.IsFileLocked(new FileInfo(builder.LocationDataPath)))
     {
         try
         {
             builder.LoadLocationData();
             Logger.Debug("updated location data file");
         }
         catch (Exception ex)
         {
             Logger.Debug(ex, "location data file locked, cannot load");
         }
     }
 }