Example #1
0
        private void ConfigureFileWatcher(InsurancePolicyRepository repository)
        {
            var fileName  = repository.FileName;
            var directory = Path.GetDirectoryName(fileName);
            var file      = Path.GetFileName(fileName);

            _fileSystemWatcher = new FileSystemWatcher(directory, file);
            // TODO: Consider Deletes and Renames if time
            _fileSystemWatcher.NotifyFilter        = NotifyFilters.LastWrite;
            _fileSystemWatcher.Changed            += fileSystemWatcher_Changed;
            _fileSystemWatcher.EnableRaisingEvents = true;
        }
        private void ConfigureFileWatcher(InsurancePolicyRepository repository)
        {
            var fileName = repository.FileName;
            var directory = Path.GetDirectoryName(fileName);
            var file = Path.GetFileName(fileName);

            _fileSystemWatcher = new FileSystemWatcher(directory, file);
            // TODO: Consider Deletes and Renames if time
            _fileSystemWatcher.NotifyFilter = NotifyFilters.LastWrite;
            _fileSystemWatcher.Changed += fileSystemWatcher_Changed;
            _fileSystemWatcher.EnableRaisingEvents = true;
        }
Example #3
0
 public RepositoryUpdatedNotificationService(InsurancePolicyRepository repository)
 {
     _repository = repository;
     ConfigureFileWatcher(repository);
 }
 public RepositoryUpdatedNotificationService(InsurancePolicyRepository repository)
 {
     _repository = repository;
     ConfigureFileWatcher(repository);
 }