public FileSystemSnapshotManager( IFileSystemNameFactory fileSystemNameFactory, IFileSystem fileSystem, IFileRegistrationTracker fileRegistrationTracker, IFileSystemSnapshotBuilder fileSystemSnapshotBuilder, IOperationProcessor operationProcessor, IProjectDiscovery projectDiscovery, IDirectoryChangeWatcherFactory directoryChangeWatcherFactory, ITaskQueueFactory taskQueueFactory, ILongRunningFileSystemTaskQueue longRunningFileSystemTaskQueue) { _fileSystemNameFactory = fileSystemNameFactory; _fileSystem = fileSystem; _fileSystemSnapshotBuilder = fileSystemSnapshotBuilder; _operationProcessor = operationProcessor; _projectDiscovery = projectDiscovery; _longRunningFileSystemTaskQueue = longRunningFileSystemTaskQueue; _fileRegistrationTracker = fileRegistrationTracker; _flushPathChangesTaskQueue = taskQueueFactory.CreateQueue("FileSystemSnapshotManager Path Changes Task Queue"); _fileRegistrationTracker.ProjectListChanged += FileRegistrationTrackerOnProjectListChanged; _fileRegistrationTracker.ProjectListRefreshed += FileRegistrationTrackerOnProjectListRefreshed; _fileSystemSnapshot = FileSystemSnapshot.Empty; _directoryChangeWatcher = directoryChangeWatcherFactory.CreateWatcher(); _directoryChangeWatcher.PathsChanged += DirectoryChangeWatcherOnPathsChanged; _directoryChangeWatcher.Error += DirectoryChangeWatcherOnError; }
public FileSystemSnapshotManager( IFileSystemNameFactory fileSystemNameFactory, IFileSystem fileSystem, IFileRegistrationTracker fileRegistrationTracker, IFileSystemSnapshotBuilder fileSystemSnapshotBuilder, IOperationProcessor operationProcessor, IProjectDiscovery projectDiscovery, IDirectoryChangeWatcherFactory directoryChangeWatcherFactory, ITaskQueueFactory taskQueueFactory, ILongRunningFileSystemTaskQueue longRunningFileSystemTaskQueue) { _fileSystemNameFactory = fileSystemNameFactory; _fileSystem = fileSystem; _fileSystemSnapshotBuilder = fileSystemSnapshotBuilder; _operationProcessor = operationProcessor; _projectDiscovery = projectDiscovery; _longRunningFileSystemTaskQueue = longRunningFileSystemTaskQueue; _fileRegistrationTracker = fileRegistrationTracker; _flushPathChangesTaskQueue = taskQueueFactory.CreateQueue("FileSystemSnapshotManager Path Changes Task Queue"); _taskExecutor = taskQueueFactory.CreateQueue("FileSystemSnapshotManager State Change Task Queue"); _fileRegistrationTracker.ProjectListChanged += FileRegistrationTrackerOnProjectListChanged; _currentSnapshot = FileSystemSnapshot.Empty; _directoryChangeWatcher = directoryChangeWatcherFactory.CreateWatcher(TimeSpan.FromSeconds(60)); _directoryChangeWatcher.PathsChanged += DirectoryChangeWatcherOnPathsChanged; _directoryChangeWatcher.Error += DirectoryChangeWatcherOnError; _directoryChangeWatcher.Paused += DirectoryChangeWatcherOnPaused; _directoryChangeWatcher.Resumed += DirectoryChangeWatcherOnResumed; }
public FileSystemSnapshotBuilder( IProjectDiscovery projectDiscovery, IProgressTrackerFactory progressTrackerFactory) { _projectDiscovery = projectDiscovery; _progressTrackerFactory = progressTrackerFactory; }
public FileRegistrationTracker(IFileSystem fileSystem, IProjectDiscovery projectDiscovery, ITaskQueueFactory taskQueueFactory) { _fileSystem = fileSystem; _projectDiscovery = projectDiscovery; _taskQueue = taskQueueFactory.CreateQueue("File Registration Tracker Task Queue"); }
public FileSystemChangesValidator( IFileSystemNameFactory fileSystemNameFactory, IProjectDiscovery projectDiscovery) { _fileSystemNameFactory = fileSystemNameFactory; _projectDiscovery = projectDiscovery; }
public FileSystemChangesValidator( IFileSystemNameFactory fileSystemNameFactory, IProjectDiscovery projectDiscovery) { _fileSystemNameFactory = fileSystemNameFactory; _projectDiscovery = projectDiscovery; }
/// <summary> /// Returns the absolute path of the project containing |filename|. /// Returns |null| if |filename| is not located within a local project directory. /// </summary> public static FullPathName GetProjectPath(this IProjectDiscovery projectDiscovery, FullPathName filename) { var project = projectDiscovery.GetProject(filename); if (project == null) { return(default(FullPathName)); } return(project.RootPath); }
/// <summary> /// Return the <see cref="ProjectFileName"/> instance of the full path <paramref name="path"/>. /// Returns the default value if <paramref name="path"/> is invalid or not part of a project. /// </summary> public static ProjectFileName CreateProjectFileFromFullPath(this IFileSystemNameFactory fileSystemNameFactory, IProjectDiscovery projectDiscovery, FullPath path) { var project = projectDiscovery.GetProject(path); if (project == null) { return(default(ProjectFileName)); } var split = PathHelpers.SplitPrefix(path.Value, project.RootPath.Value); return(CreateProjectFileNameFromRelativePath(fileSystemNameFactory, project, new RelativePath(split.Suffix))); }
public FileSystemProcessor( IFileSystemNameFactory fileSystemNameFactory, IProjectDiscovery projectDiscovery, IDirectoryChangeWatcherFactory directoryChangeWatcherFactory, ITaskQueueFactory taskQueueFactory, IFileSystemSnapshotBuilder fileSystemSnapshotBuilder, IOperationProcessor<SnapshotComputedEventArgs> snapshotOperationProcessor) { _fileSystemNameFactory = fileSystemNameFactory; _directoryChangeWatcher = directoryChangeWatcherFactory.CreateWatcher(); _fileSystemSnapshotBuilder = fileSystemSnapshotBuilder; _snapshotOperationProcessor = snapshotOperationProcessor; _projectDiscovery = projectDiscovery; _taskQueue = taskQueueFactory.CreateQueue(); _directoryChangeWatcher.PathsChanged += DirectoryChangeWatcherOnPathsChanged; _fileSystemSnapshot = FileSystemTreeSnapshot.Empty; }
public FileSystemProcessor( IFileSystemNameFactory fileSystemNameFactory, IProjectDiscovery projectDiscovery, IDirectoryChangeWatcherFactory directoryChangeWatcherFactory, ITaskQueueFactory taskQueueFactory, IFileSystemSnapshotBuilder fileSystemSnapshotBuilder, IOperationProcessor <SnapshotComputedEventArgs> snapshotOperationProcessor) { _fileSystemNameFactory = fileSystemNameFactory; _directoryChangeWatcher = directoryChangeWatcherFactory.CreateWatcher(); _fileSystemSnapshotBuilder = fileSystemSnapshotBuilder; _snapshotOperationProcessor = snapshotOperationProcessor; _projectDiscovery = projectDiscovery; _taskQueue = taskQueueFactory.CreateQueue(); _directoryChangeWatcher.PathsChanged += DirectoryChangeWatcherOnPathsChanged; _fileSystemSnapshot = FileSystemTreeSnapshot.Empty; }
public FileSystemProcessor( IFileSystemNameFactory fileSystemNameFactory, IFileSystem fileSystem, IFileSystemSnapshotBuilder fileSystemSnapshotBuilder, IOperationProcessor operationProcessor, IProjectDiscovery projectDiscovery, IDirectoryChangeWatcherFactory directoryChangeWatcherFactory, ITaskQueueFactory taskQueueFactory) { _fileSystemNameFactory = fileSystemNameFactory; _fileSystem = fileSystem; _fileSystemSnapshotBuilder = fileSystemSnapshotBuilder; _operationProcessor = operationProcessor; _projectDiscovery = projectDiscovery; _taskQueue = taskQueueFactory.CreateQueue("FileSystemProcessor Task Queue"); _fileSystemSnapshot = FileSystemTreeSnapshot.Empty; _directoryChangeWatcher = directoryChangeWatcherFactory.CreateWatcher(); _directoryChangeWatcher.PathsChanged += DirectoryChangeWatcherOnPathsChanged; }
public FileSystemProcessor( IFileSystemNameFactory fileSystemNameFactory, IFileSystem fileSystem, IFileSystemSnapshotBuilder fileSystemSnapshotBuilder, IOperationProcessor operationProcessor, IProjectDiscovery projectDiscovery, IDirectoryChangeWatcherFactory directoryChangeWatcherFactory, ITaskQueueFactory taskQueueFactory) { _fileSystemNameFactory = fileSystemNameFactory; _fileSystem = fileSystem; _fileSystemSnapshotBuilder = fileSystemSnapshotBuilder; _operationProcessor = operationProcessor; _projectDiscovery = projectDiscovery; _taskQueue = taskQueueFactory.CreateQueue("FileSystemProcessor Task Queue"); _fileSystemSnapshot = FileSystemTreeSnapshot.Empty; _directoryChangeWatcher = directoryChangeWatcherFactory.CreateWatcher(); _directoryChangeWatcher.PathsChanged += DirectoryChangeWatcherOnPathsChanged; _directoryChangeWatcher.Error += DirectoryChangeWatcherOnError; }
public SearchEngine( IFileSystemProcessor fileSystemProcessor, IFileSystemNameFactory fileSystemNameFactory, ICustomThreadPool customThreadPool, IFileDatabaseFactory fileDatabaseFactory, IProjectDiscovery projectDiscovery, ISearchStringParser searchStringParser, IOperationProcessor <OperationResultEventArgs> fileLoadingOperationProcessor) { _fileSystemNameFactory = fileSystemNameFactory; _customThreadPool = customThreadPool; _fileDatabaseFactory = fileDatabaseFactory; _projectDiscovery = projectDiscovery; _searchStringParser = searchStringParser; _fileLoadingOperationProcessor = fileLoadingOperationProcessor; // Create a "Null" state _currentFileDatabase = _fileDatabaseFactory.CreateEmpty(); // Setup computing a new state everytime a new tree is computed. fileSystemProcessor.SnapshotComputed += FileSystemProcessorOnSnapshotComputed; fileSystemProcessor.FilesChanged += FileSystemProcessorOnFilesChanged; }
public SearchEngine( IFileSystemSnapshotManager fileSystemSnapshotManager, IFileSystemNameFactory fileSystemNameFactory, ILongRunningFileSystemTaskQueue taskQueue, IFileDatabaseSnapshotFactory fileDatabaseSnapshotFactory, IProjectDiscovery projectDiscovery, ICompiledTextSearchDataFactory compiledTextSearchDataFactory, IOperationProcessor operationProcessor) { _fileSystemNameFactory = fileSystemNameFactory; _taskQueue = taskQueue; _fileDatabaseSnapshotFactory = fileDatabaseSnapshotFactory; _projectDiscovery = projectDiscovery; _compiledTextSearchDataFactory = compiledTextSearchDataFactory; _operationProcessor = operationProcessor; // Create a "Null" state _currentFileDatabase = _fileDatabaseSnapshotFactory.CreateEmpty(); // Setup computing a new state everytime a new tree is computed. fileSystemSnapshotManager.SnapshotScanFinished += FileSystemSnapshotManagerOnSnapshotScanFinished; fileSystemSnapshotManager.FilesChanged += FileSystemSnapshotManagerOnFilesChanged; }
public SearchEngine( IFileSystemProcessor fileSystemProcessor, IFileSystemNameFactory fileSystemNameFactory, ITaskQueueFactory taskQueueFactory, IFileDatabaseFactory fileDatabaseFactory, IProjectDiscovery projectDiscovery, ICompiledTextSearchDataFactory compiledTextSearchDataFactory, IOperationProcessor operationProcessor) { _fileSystemNameFactory = fileSystemNameFactory; _taskQueue = taskQueueFactory.CreateQueue("SearchEngine Task Queue"); _fileDatabaseFactory = fileDatabaseFactory; _projectDiscovery = projectDiscovery; _compiledTextSearchDataFactory = compiledTextSearchDataFactory; _operationProcessor = operationProcessor; // Create a "Null" state _currentFileDatabase = _fileDatabaseFactory.CreateEmpty(); // Setup computing a new state everytime a new tree is computed. fileSystemProcessor.SnapshotComputed += FileSystemProcessorOnSnapshotComputed; fileSystemProcessor.FilesChanged += FileSystemProcessorOnFilesChanged; }
/// <summary> /// Return the |FileName| instance corresponding to the full path |path|. /// Returns |null| if |path| is invalid or not part of a project. /// </summary> public static ProjectFileName GetProjectFileName(IFileSystemNameFactory fileSystemNameFactory, IProjectDiscovery projectDiscovery, FullPath path) { var project = projectDiscovery.GetProject(path); if (project == null) { return(default(ProjectFileName)); } var split = PathHelpers.SplitPrefix(path.Value, project.RootPath.Value); var relativePath = split.Suffix; var directoryName = fileSystemNameFactory.CreateAbsoluteDirectoryName(project.RootPath); var names = relativePath.Split(Path.DirectorySeparatorChar); foreach (var name in names) { if (name == names.Last()) { return(new ProjectFileName(project, fileSystemNameFactory.CreateFileName(directoryName, name))); } directoryName = fileSystemNameFactory.CreateDirectoryName(directoryName, name); } return(default(ProjectFileName)); }
/// <summary> /// Return the |FileName| instance corresponding to the full path |path|. Returns |null| if |path| /// is invalid or not part of a project. /// </summary> public static Tuple <IProject, FileName> GetProjectFileName(IFileSystemNameFactory fileSystemNameFactory, IProjectDiscovery projectDiscovery, FullPathName path) { var project = projectDiscovery.GetProject(path); if (project == null) { return(null); } var rootPath = project.RootPath; var rootLength = rootPath.FullName.Length + 1; if (rootPath.FullName.Last() == Path.DirectorySeparatorChar) { rootLength--; } var directoryName = fileSystemNameFactory.CreateAbsoluteDirectoryName(rootPath); var relativePath = path.FullName.Substring(rootLength); var items = relativePath.Split(new char[] { Path.DirectorySeparatorChar }); foreach (var item in items) { if (item == items.Last()) { return(Tuple.Create(project, fileSystemNameFactory.CreateFileName(directoryName, item))); } directoryName = fileSystemNameFactory.CreateDirectoryName(directoryName, item); } return(null); }
public StyleCopLinter( IProjectDiscovery projectDiscovery) { this.m_ProjectDiscovery = projectDiscovery; }
public StyleCopLinter( IProjectDiscovery projectDiscovery) { this.m_ProjectDiscovery = projectDiscovery; }