Exemplo n.º 1
0
        public MsBuildFileSystemWatcher(string directory, string filter, int delayMilliseconds, int recoveryDelayMilliseconds, IFileSystem fileSystem, IMsBuildFileSystemFilter fileSystemFilter, IActionLog log, TaskScheduler taskScheduler = null)
        {
            Requires.NotNullOrWhiteSpace(directory, nameof(directory));
            Requires.NotNullOrWhiteSpace(filter, nameof(filter));
            Requires.Range(delayMilliseconds >= 0, nameof(delayMilliseconds));
            Requires.Range(recoveryDelayMilliseconds >= 0, nameof(recoveryDelayMilliseconds));
            Requires.NotNull(fileSystem, nameof(fileSystem));
            Requires.NotNull(fileSystemFilter, nameof(fileSystemFilter));

            _directory                 = directory;
            _filter                    = filter;
            _delayMilliseconds         = delayMilliseconds;
            _recoveryDelayMilliseconds = recoveryDelayMilliseconds;
            _fileSystem                = fileSystem;
            _fileSystemFilter          = fileSystemFilter;
            _taskScheduler             = taskScheduler ?? TaskScheduler.Default;
            _log = log;

            _entries        = new MsBuildFileSystemWatcherEntries();
            _queue          = new ConcurrentQueue <IFileSystemChange>();
            _broadcastBlock = new BroadcastBlock <Changeset>(b => b, new DataflowBlockOptions {
                TaskScheduler = _taskScheduler
            });
            SourceBlock = _broadcastBlock.SafePublicize();
            _fileSystemFilter.Seal();
        }
 public DirectoryCreated(MsBuildFileSystemWatcherEntries entries, string rootDirectory, IFileSystem fileSystem, IMsBuildFileSystemFilter fileSystemFilter, string directoryFullPath)
 {
     _entries           = entries;
     _rootDirectory     = rootDirectory;
     _fileSystem        = fileSystem;
     _fileSystemFilter  = fileSystemFilter;
     _directoryFullPath = directoryFullPath;
 }
Exemplo n.º 3
0
 public DirectoryRenamed(MsBuildFileSystemWatcherEntries entries, string rootDirectory, IFileSystem fileSystem, IMsBuildFileSystemFilter fileSystemFilter, string oldFullPath, string fullPath)
 {
     _entries          = entries;
     _rootDirectory    = rootDirectory;
     _fileSystem       = fileSystem;
     _fileSystemFilter = fileSystemFilter;
     _oldFullPath      = oldFullPath;
     _fullPath         = fullPath;
 }
Exemplo n.º 4
0
 public DirectoryDeleted(MsBuildFileSystemWatcherEntries entries, string rootDirectory, string fullPath)
 {
     _entries       = entries;
     _rootDirectory = rootDirectory;
     _fullPath      = fullPath;
 }