Beispiel #1
0
        public Watcher(IRepository repository, IFileChangeBL fileChangeBl, Project project)
        {
            if (repository == null)
            {
                throw new ArgumentNullException("repository");
            }
            if (fileChangeBl == null)
            {
                throw new ArgumentNullException("fileChangeBl");
            }
            if (project == null)
            {
                throw new ArgumentNullException("project");
            }

            _repository   = repository;
            _fileChangeBl = fileChangeBl;
            _project      = project;

            _fileSystemWatcher = new FileSystemWatcher(project.PathRoot)
            {
                EnableRaisingEvents   = false,
                IncludeSubdirectories = true
            };

            _fileSystemWatcher.Changed += fileSystemWatcher_Changed;
            _fileSystemWatcher.Created += fileSystemWatcher_Created;
            _fileSystemWatcher.Deleted += fileSystemWatcher_Deleted;
            _fileSystemWatcher.Error   += fileSystemWatcher_Error;
            _fileSystemWatcher.Renamed += fileSystemWatcher_Renamed;
        }
 public IWatcher Create(IRepository repository, IFileChangeBL fileChangeBL, Project project)
 {
     return(new Watcher(repository, fileChangeBL, project));
 }