示例#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 FeedbackForm(IApplicatonLauncher launcher, IMessageBus bus)
 {
     _launcher = launcher;
     _bus = bus;
     InitializeComponent();
     runFeedback.PrintMessage(new UI.RunMessages(UI.RunMessageType.Normal, "Listening for changes"));
 }
示例#3
0
 public FeedbackForm(IApplicatonLauncher launcher, IMessageBus bus)
 {
     _launcher = launcher;
     _bus = bus;
     addContextMenues();
     InitializeComponent();
     _provider = new FeedbackProvider(
         new LabelItembehaviour(runFeedback.linkLabelCancelRun),
         new LabelItembehaviour(runFeedback.linkLabelDebugTest),
         new LabelItembehaviour(runFeedback.linkLabelTestDetails),
         new LabelItembehaviour(runFeedback.linkLabelErrorDescription));
     runFeedback.SetFeedbackProvider(_provider);
 }
		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();
		}
        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);
        }
示例#6
0
 public GoToHandler(IApplicatonLauncher launcher) {
     _launcher = launcher;
 }