예제 #1
0
 public static void EnqueueFile(MonitorFile file)
 {
     lock (FileQueue) {
         if (FileQueue.Count > 0)
         {
             MonitorFile top = FileQueue.Peek();
             if (top != null && top.full_path == file.full_path)
             {
                 return;
             }
         }
         FileQueue.Enqueue(file);
     }
 }
예제 #2
0
 private void changed(Object sender, FileSystemEventArgs e)
 {
     MonitorFile add_me = new MonitorFile(this);
     add_me.root = (sender as FileSystemWatcher).Path;
     add_me.path = e.Name;
     add_me.change_type = e.ChangeType;
     add_me.origin = Origin.Game;
     if (e.ChangeType == WatcherChangeTypes.Renamed) {
         try {
             add_me.old_path = ((RenamedEventArgs)e).OldName;
         } catch {
             add_me.old_path = null;
         }
     } else {
         add_me.old_path = null;
     }
     Monitor.EnqueueFile(add_me);
 }
예제 #3
0
        private void changed(Object sender, FileSystemEventArgs e)
        {
            MonitorFile add_me = new MonitorFile(this);

            add_me.root        = (sender as FileSystemWatcher).Path;
            add_me.path        = e.Name;
            add_me.change_type = e.ChangeType;
            add_me.origin      = Origin.Game;
            if (e.ChangeType == WatcherChangeTypes.Renamed)
            {
                try {
                    add_me.old_path = ((RenamedEventArgs)e).OldName;
                } catch {
                    add_me.old_path = null;
                }
            }
            else
            {
                add_me.old_path = null;
            }
            Monitor.EnqueueFile(add_me);
        }
예제 #4
0
파일: Monitor.cs 프로젝트: Korn1699/MASGAU
 public static void EnqueueFile(MonitorFile file)
 {
     lock (FileQueue) {
         if (FileQueue.Count > 0) {
             MonitorFile top = FileQueue.Peek();
             if (top != null && top.full_path == file.full_path)
                 return;
         }
         FileQueue.Enqueue(file);
     }
 }