Пример #1
0
        public DirectoryWatcher(IMessageBus bus, IWatchValidator validator, IConfiguration configuration, IHandleDelayedConfiguration delayedConfigurer, IWatchPathLocator watchPathLocator, IApplicatonLauncher launcer, ICache cache, IMarkProjectsForRebuild rebuildMarker, ISolutionChangeConsumer solutionHanlder)
        {
            _bus = bus;
            _validator = validator;
			_configuration = configuration;
			_delayedConfigurer = delayedConfigurer;
            _watchPathLocator = watchPathLocator;
			_launcer = launcer;
            _cache = cache;
            _rebuildMarker = rebuildMarker;
            _solutionHanlder = solutionHanlder;
            _watcher = new FileSystemWatcher
                           {
                               NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.Size | NotifyFilters.Attributes,
                               IncludeSubdirectories = true,
                               Filter = "*.*",
                           };
            
            _watcher.Changed += WatcherChangeHandler;
            _watcher.Created += WatcherChangeHandler;
            _watcher.Deleted += WatcherChangeHandler;
            _watcher.Renamed += WatcherChangeHandler;
            _watcher.Error += WatcherErrorHandler;
            if (!_configuration.StartPaused)
                Resume();
        }
Пример #2
0
 public void SetUp()
 {
     _messageBus = MockRepository.GenerateMock<IMessageBus>();
     _validator = MockRepository.GenerateMock<IWatchValidator>();
     _watcher = new DirectoryWatcher(_messageBus, _validator);
     _file = Path.GetFullPath("watcher_test.txt");
     _watcher.Watch(Path.GetDirectoryName(_file));
 }
Пример #3
0
        public void SetUp()
        {
            _messageBus = MockRepository.GenerateMock<IMessageBus>();
            _validator = MockRepository.GenerateMock<IWatchValidator>();
			_configuration = MockRepository.GenerateMock<IConfiguration>();
			_validator.Stub(v => v.GetIgnorePatterns()).Return("");
			_configuration.Stub(c => c.FileChangeBatchDelay).Return(50);
            _watcher = new DirectoryWatcher(_messageBus, _validator, _configuration);
            _file = Path.GetFullPath("watcher_test.txt");
			_watchDirectory = Path.GetDirectoryName(_file);
            _watcher.Watch(_watchDirectory);
        }
		public DirectoryWatcher(IMessageBus bus, IWatchValidator validator, IConfiguration configuration, IHandleDelayedConfiguration delayedConfigurer, IWatchPathLocator watchPathLocator, IApplicatonLauncher launcer, ICache cache, IMarkProjectsForRebuild rebuildMarker, ISolutionChangeConsumer solutionHanlder)
		{
			_bus = bus;
			_validator = validator;
			_configuration = configuration;
			_delayedConfigurer = delayedConfigurer;
			_watchPathLocator = watchPathLocator;
			_launcer = launcer;
			_cache = cache;
			_rebuildMarker = rebuildMarker;
			_solutionHanlder = solutionHanlder;
			if (!_configuration.StartPaused)
				Resume();
		}
Пример #5
0
        public void SetUp()
        {
            _messageBus = MockRepository.GenerateMock<IMessageBus>();
            _validator = MockRepository.GenerateMock<IWatchValidator>();
			_configuration = MockRepository.GenerateMock<IConfiguration>();
			_validator.Stub(v => v.GetIgnorePatterns()).Return("");
			_configuration.Stub(c => c.FileChangeBatchDelay).Return(50);
            _watcher = new DirectoryWatcher(_messageBus, _validator, _configuration, MockRepository.GenerateMock<IHandleDelayedConfiguration>());
            _file = Path.GetFullPath("watcher_test.txt");
            _directory = Path.GetFullPath("mytestfolder");
			_watchDirectory = Path.GetDirectoryName(_file);
			_localConfig = Path.Combine(_watchDirectory, "AutoTest.config");
			File.WriteAllText(_localConfig, "<configuration></configuration>");
            _watcher.Watch(_watchDirectory);
        }
Пример #6
0
        public DirectoryWatcher(IMessageBus bus, IWatchValidator validator, IConfiguration configuration)
        {
            _bus = bus;
            _validator = validator;
			_configuration = configuration;
            _watcher = new FileSystemWatcher
                           {
                               NotifyFilter = NotifyFilters.LastWrite,
                               IncludeSubdirectories = true,
                               Filter = "*.*",
                           };
            
            _watcher.Changed += WatcherChangeHandler;
            _watcher.Created += WatcherChangeHandler;
        }
Пример #7
0
 public DirectoryWatcher(IMessageBus bus, IWatchValidator validator)
 {
     _bus = bus;
     _validator = validator;
     _batchTimer = new Timer(100);
     _batchTimer.Enabled = true;
     _batchTimer.Elapsed += _batchTimer_Elapsed;
     _watcher = new FileSystemWatcher
                    {
                        NotifyFilter = NotifyFilters.LastWrite,
                        IncludeSubdirectories = true,
                        Filter = "*.*",
                    };
     
     _watcher.Changed += WatcherChangeHandler;
     _watcher.Created += WatcherChangeHandler;
 }
Пример #8
0
        public DirectoryWatcher(IMessageBus bus, IWatchValidator validator, IConfiguration configuration, IHandleDelayedConfiguration delayedConfigurer, IWatchPathLocator watchPathLocator)
        {
            _bus = bus;
            _validator = validator;
			_configuration = configuration;
			_delayedConfigurer = delayedConfigurer;
            _watchPathLocator = watchPathLocator;
            _watcher = new FileSystemWatcher
                           {
                               NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.Size | NotifyFilters.Attributes,
                               IncludeSubdirectories = true,
                               Filter = "*.*",
                           };
            
            _watcher.Changed += WatcherChangeHandler;
            _watcher.Created += WatcherChangeHandler;
            _watcher.Deleted += WatcherChangeHandler;
            _watcher.Renamed += WatcherChangeHandler;
            _watcher.Error += WatcherErrorHandler;
            if (!_configuration.StartPaused)
                Resume();
        }
Пример #9
0
        public void SetUp()
        {
			_launcer = MockRepository.GenerateMock<IApplicatonLauncher>();
            _messageBus = MockRepository.GenerateMock<IMessageBus>();
            _validator = MockRepository.GenerateMock<IWatchValidator>();
			_configuration = MockRepository.GenerateMock<IConfiguration>();
            _pathLocator = MockRepository.GenerateMock<IWatchPathLocator>();
            _cahce = MockRepository.GenerateMock<ICache>();
            _slnConsumer = MockRepository.GenerateMock<ISolutionChangeConsumer>();
            _rebuildMarker = MockRepository.GenerateMock<IMarkProjectsForRebuild>();
            _configuration.Stub(x => x.IgnoreFile).Return("");
			_validator.Stub(v => v.GetIgnorePatterns()).Return("");
			_configuration.Stub(c => c.FileChangeBatchDelay).Return(50);
            _configuration.Stub(c => c.WatchAllFiles).Return(true);
            _configuration.Stub(c => c.WatchToken).Return(_watchDirectory);
            _watcher = new DirectoryWatcher(_messageBus, _validator, _configuration, MockRepository.GenerateMock<IHandleDelayedConfiguration>(), _pathLocator, _launcer, _cahce, _rebuildMarker, _slnConsumer);
            _file = Path.GetFullPath("watcher_test.txt");
            _directory = Path.GetFullPath("mytestfolder");
			_watchDirectory = Path.GetDirectoryName(_file);
            _pathLocator.Stub(x => x.Locate(_watchDirectory)).Return(_watchDirectory);
			_localConfig = new PathTranslator(_watchDirectory).Translate(Path.Combine(_watchDirectory, "AutoTest.config"));
			File.WriteAllText(_localConfig, "<configuration></configuration>");
            _watcher.Watch(_watchDirectory);
        }