private void SetupWatcher() { if (this.watcher == null) { FileSystemWatcher fsw = new FileSystemWatcher(); FileSystemWatcherAdapter fswAdapter = new FileSystemWatcherAdapter(fsw); this.watcher = new WatcherObservable(fswAdapter) { Path = this.settings.WatchPath }; this.watcher.Stop(); } }
public FilePathModel( ISettings _settings, BehaviorSubject <string> _localPathSubject, IWatcherObservable _watcher ) { this.settings = _settings; this.LocalPathSubject = _localPathSubject; // Set up File Watcher this.watcher = _watcher; this.ChangeWatchPath(this.settings.WatchPath); logger.Debug("FilePathModel Initialized"); }