Exemple #1
0
        public DirectoryWatcher(string directoryPath, IFileWatcherDispatcher dispatcher)
        {
            this.directoryPath = directoryPath;
            this.dispatcher    = dispatcher;

            watcher = FileSystemWatcherUtils.CreateDirectoryWatcher(
                this.directoryPath,
                OnPathCreated,
                OnPathChanged,
                OnPathDeleted,
                OnPathRenamed,
                OnError
                );
        }
        public SingleFileWatcher(string filePath, IFileWatcherDispatcher dispatcher)
        {
            this.filePath   = filePath;
            this.dispatcher = dispatcher;

            watcher = FileSystemWatcherUtils.CreateSingleFileWatcher(
                filePath,
                OnPathCreated,
                OnPathChanged,
                OnPathDeleted,
                OnPathRenamed,
                OnError
                );

            Changes = changes.Select(x => new FileChangedEvent(filePath, x));
        }
Exemple #3
0
 public FileWatcherFactory(IFileWatcherDispatcher dispatcher)
 {
     this.dispatcher = dispatcher;
 }