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.");
     }
 }
예제 #2
0
 public static IFileObserver Create(ObserveFileDto fileToObserve, IFileNotifier[] fileNotifier)
 {
     return(CreateFunction(fileToObserve, fileNotifier));
 }
예제 #3
0
 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);
        }