Пример #1
0
        public DirectoryWatchdog(string directoryPath, string filter, IWatchdogThread watchdogThread)
        {
            if (directoryPath == null)
            {
                throw new ArgumentNullException(nameof(directoryPath));
            }

            _directoryPath  = directoryPath;
            _filter         = filter;
            _watchdogThread = watchdogThread;
            _filterRegex    = GetFilterRegex(filter);
            if (directoryPath == null)
            {
                throw new ArgumentNullException(nameof(directoryPath));
            }
            if (!Directory.Exists(directoryPath))
            {
                throw new InvalidOperationException($"Directory {directoryPath} does not exist");
            }

            _watcher = new FileSystemWatcher(directoryPath, filter)
            {
                IncludeSubdirectories = true
            };
            _watcher.Created += OnCreated;
            _watcher.Renamed += OnRenamed;
            _watcher.Changed += OnChanged;
            _watcher.Deleted += OnDeleted;
        }
Пример #2
0
        public SynchronizerEngine
        (
            IWatchdogThread watchdogThread,
            IControllerFactory controllerFactory,
            IConfigurationReader configurationReader,

            IHealthChecker healthChecker
        )
            : base(watchdogThread, controllerFactory)
        {
            _configurationReader = configurationReader;
            _healthChecker       = healthChecker;
        }
Пример #3
0
 public NodeEngine(IWatchdogThread watchdogThread, IControllerFactory controllerFactory, IConfigurationReader configurationReader)
     : base(watchdogThread, controllerFactory)
 {
     _configurationReader = configurationReader;
 }
Пример #4
0
 protected Engine(IWatchdogThread watchdogThread, IControllerFactory controllerFactory)
 {
     _watchdogThread    = watchdogThread;
     _controllerFactory = controllerFactory;
 }
Пример #5
0
 public EngineTester(IWatchdogThread watchdogThread, IControllerFactory controllerFactory, RestConfiguration restConfiguration)
     : base(watchdogThread, controllerFactory)
 {
     _restConfiguration = restConfiguration;
 }