Пример #1
0
        public TimesheetProcessingService(ConsolidatingFileSystemMonitor fileSystemMonitor, TaskScheduler scheduler, TimeEntryRowReader entryRowReader, TimeEntryProcessor processor)
        {
            _scheduler      = scheduler;
            _entryRowReader = entryRowReader;
            _processor      = processor;
            _consolidatingFileSystemMonitor = fileSystemMonitor;

            _consolidatingFileSystemMonitor.WhenFileChanged(fileName => _scheduler.Schedule(() => OnChangedFile(fileName)));
        }
        public void Setup()
        {
            _changedFiles = new List <string>();

            _monitor             = new ConsolidatingFileSystemMonitor(TestHelper.WatchRoot, "*.*");
            _monitor.GracePeriod = 250;
            _monitor.WhenFileChanged(_changedFiles.Add);
            _monitor.Start();
        }