コード例 #1
0
 private static void uploaderConfigWatcher_Changed(object sender, FileSystemEventArgs e)
 {
     if (!uploaderConfigWatcherTimer.IsDuplicateEvent(e.FullPath))
     {
         Action onCompleted = () => ReloadUploadersConfig(e.FullPath);
         Helpers.WaitWhileAsync(() => Helpers.IsFileLocked(e.FullPath), 250, 5000, onCompleted, 1000);
         uploaderConfigWatcherTimer = new WatchFolderDuplicateEventTimer(e.FullPath);
     }
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: Z1ni/ShareX
 private static void uploaderConfigWatcher_Changed(object sender, FileSystemEventArgs e)
 {
     if (!uploaderConfigWatcherTimer.IsDuplicateEvent(e.FullPath))
     {
         SynchronizationContext context = SynchronizationContext.Current ?? new SynchronizationContext();
         Action onCompleted             = () => context.Post(state => ReloadUploadersConfig(e.FullPath), null);
         Helpers.WaitWhileAsync(() => Helpers.IsFileLocked(e.FullPath), 250, 5000, onCompleted, 1000);
         uploaderConfigWatcherTimer = new WatchFolderDuplicateEventTimer(e.FullPath);
     }
 }