예제 #1
0
        protected override Task ExecuteAsync(CancellationToken stoppingToken)
        {
            foreach (var project in _projectWatcherRepository.GetProjectWatchers())
            {
                _fileWatcherService.WatchTestProject(project);
            }

            _fileWatcherService.WatchForChangesInWatchedProjectFile();

            return(Task.CompletedTask);
        }
        private void OnWatchProjectFileChanged(Guid myApplicationId, FileSystemEventArgs e)
        {
            var projectsToWatch = _projectWatcherRepository.GetProjectWatchers();

            foreach (var project in projectsToWatch)
            {
                if (!_fileWatcherLookUp.ContainsKey(project.ProjectWatcherId))
                {
                    WatchTestProject(project);
                }
            }

            var projectsToStopWatching = GetProjectsToStopWatching(myApplicationId, projectsToWatch);

            foreach (var projectId in projectsToStopWatching)
            {
                RemoveProjectFromWatcher(projectId);
            }
        }
 public IReadOnlyList <ProjectWatcher> GetWatchedProjects()
 {
     return(_projectWatcherRepository.GetProjectWatchers());
 }