private void AddToObserverList(ObserveFileDto fileToObserve, IFileObserver adapter) { if (!_observedFiles.ContainsKey(fileToObserve)) { adapter.Start(); _observedFiles.Add(fileToObserve, adapter); } else { throw new ArgumentException("This path was added to observable list before."); } }
public static IFileObserver Create(ObserveFileDto fileToObserve, IFileNotifier[] fileNotifier) { return(CreateFunction(fileToObserve, fileNotifier)); }
public FileWatchDog(ObserveFileDto dto, params IFileNotifier[] notifier) { _dto = dto; _notifier = new List <IFileNotifier>(notifier); }
public void Set(ObserveFileDto fileToObserve) { IFileObserver adapter = FileObserver.Create(fileToObserve, _fileNotifier); AddToObserverList(fileToObserve, adapter); }