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

            watcher = FileSystemWatcherUtils.CreateDirectoryWatcher(
                this.directoryPath,
                OnPathCreated,
                OnPathChanged,
                OnPathDeleted,
                OnPathRenamed,
                OnError
                );
        }
Beispiel #2
0
        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));
        }