예제 #1
0
        private void OnPathsChangedTask(IList <PathChangeEntry> changes)
        {
            var result =
                new FileSystemChangesValidator(_fileSystemNameFactory, _projectDiscovery).ProcessPathsChangedEvent(changes);

            if (result.RecomputeGraph)
            {
                RecomputeGraph();
            }
            else if (result.ChangedFiles.Any())
            {
                OnFilesChanged(new FilesChangedEventArgs {
                    ChangedFiles = result.ChangedFiles.ToReadOnlyCollection()
                });
            }
        }
        private void ProcessPendingPathChanges()
        {
            var changes = _pathsChangedQueue
                          .DequeueAll()
                          .SelectMany(x => x)
                          .ToList();

            var validationResult = new FileSystemChangesValidator(_fileSystemNameFactory, _fileSystem, _projectDiscovery)
                                   .ProcessPathsChangedEvent(changes);

            switch (validationResult.Kind)
            {
            case FileSystemValidationResultKind.NoChanges:
                return;

            case FileSystemValidationResultKind.FileModificationsOnly:
                OnFilesChanged(new FilesChangedEventArgs {
                    FileSystemSnapshot = _currentSnapshot,
                    ChangedFiles       = validationResult.ModifiedFiles.ToReadOnlyCollection()
                });
                return;

            case FileSystemValidationResultKind.VariousFileChanges:
                _longRunningFileSystemTaskQueue.Enqueue(FilesChangedTaskId, cancellationToken => {
                    RescanFileSystem(_registeredProjects, validationResult.FileChanges, cancellationToken);
                });
                return;

            case FileSystemValidationResultKind.UnknownChanges:
                _fileRegistrationTracker.RefreshAsync(FileRegistrationTrackerRefreshCompleted);
                return;

            default:
                Invariants.Assert(false, "What kind of validation result is this?");
                return;
            }
        }
예제 #3
0
        private void FlushPathsChangedQueueTask()
        {
            var changes = _pathsChangedQueue
                          .DequeueAll()
                          .SelectMany(x => x)
                          .ToList();

            var validationResult = new FileSystemChangesValidator(_fileSystemNameFactory, _fileSystem, _projectDiscovery)
                                   .ProcessPathsChangedEvent(changes);

            if (validationResult.NoChanges)
            {
                return;
            }

            if (validationResult.FileModificationsOnly)
            {
                OnFilesChanged(new FilesChangedEventArgs {
                    ChangedFiles = validationResult.ModifiedFiles.ToReadOnlyCollection()
                });
                return;
            }

            if (validationResult.VariousFileChanges)
            {
                RecomputeGraph(validationResult.FileChanges);
                return;
            }

            if (validationResult.UnknownChanges)
            {
                RecomputeGraph(null /* force rescan*/);
                return;
            }

            Debug.Assert(false, "What kind of validation result is this?");
        }
 private void OnPathsChangedTask(IList<PathChangeEntry> changes)
 {
     var result =
     new FileSystemChangesValidator(_fileSystemNameFactory, _projectDiscovery).ProcessPathsChangedEvent(changes);
       if (result.RecomputeGraph) {
     RecomputeGraph();
       } else if (result.ChangedFiles.Any()) {
     OnFilesChanged(new FilesChangedEventArgs {
       ChangedFiles = result.ChangedFiles.ToReadOnlyCollection()
     });
       }
 }
예제 #5
0
    private void FlushPathsChangedQueueTask() {
      var changes = _pathsChangedQueue
        .DequeueAll()
        .SelectMany(x => x)
        .ToList();

      var validationResult = new FileSystemChangesValidator(_fileSystemNameFactory, _fileSystem, _projectDiscovery)
        .ProcessPathsChangedEvent(changes);

      if (validationResult.NoChanges) {
        return;
      }

      if (validationResult.FileModificationsOnly) {
        OnFilesChanged(new FilesChangedEventArgs {
          ChangedFiles = validationResult.ModifiedFiles.ToReadOnlyCollection()
        });
        return;
      }

      if (validationResult.VariousFileChanges) {
        RecomputeGraph(validationResult.FileChanges);
        return;
      }

      if (validationResult.UnknownChanges) {
        RecomputeGraph(null /* force rescan*/);
        return;
      }

      Debug.Assert(false, "What kind of validation result is this?");
    }