Example #1
0
        public DefaultProjectSnapshotManager(
            ForegroundDispatcher foregroundDispatcher,
            ErrorReporter errorReporter,
            ProjectSnapshotWorker worker,
            IEnumerable <ProjectSnapshotChangeTrigger> triggers,
            Workspace workspace)
        {
            if (foregroundDispatcher == null)
            {
                throw new ArgumentNullException(nameof(foregroundDispatcher));
            }

            if (errorReporter == null)
            {
                throw new ArgumentNullException(nameof(errorReporter));
            }

            if (worker == null)
            {
                throw new ArgumentNullException(nameof(worker));
            }

            if (triggers == null)
            {
                throw new ArgumentNullException(nameof(triggers));
            }

            if (workspace == null)
            {
                throw new ArgumentNullException(nameof(workspace));
            }

            _foregroundDispatcher = foregroundDispatcher;
            _errorReporter        = errorReporter;
            _worker   = worker;
            _triggers = triggers.ToArray();
            Workspace = workspace;

            _projects    = new Dictionary <ProjectId, DefaultProjectSnapshot>();
            _workerQueue = new ProjectSnapshotWorkerQueue(_foregroundDispatcher, this, worker);

            for (var i = 0; i < _triggers.Length; i++)
            {
                _triggers[i].Initialize(this);
            }
        }
Example #2
0
        public ProjectSnapshotWorkerQueue(ForegroundDispatcher foregroundDispatcher, DefaultProjectSnapshotManager projectManager, ProjectSnapshotWorker projectWorker)
        {
            if (foregroundDispatcher == null)
            {
                throw new ArgumentNullException(nameof(foregroundDispatcher));
            }

            if (projectManager == null)
            {
                throw new ArgumentNullException(nameof(projectManager));
            }

            if (projectWorker == null)
            {
                throw new ArgumentNullException(nameof(projectWorker));
            }

            _foregroundDispatcher = foregroundDispatcher;
            _projectManager       = projectManager;
            _projectWorker        = projectWorker;

            _projects = new Dictionary <string, ProjectSnapshotUpdateContext>(FilePathComparer.Instance);
        }
Example #3
0
        public ProjectSnapshotWorkerQueue(ForegroundDispatcher foregroundDispatcher, DefaultProjectSnapshotManager projectManager, ProjectSnapshotWorker projectWorker)
        {
            if (foregroundDispatcher == null)
            {
                throw new ArgumentNullException(nameof(foregroundDispatcher));
            }

            if (projectManager == null)
            {
                throw new ArgumentNullException(nameof(projectManager));
            }

            if (projectWorker == null)
            {
                throw new ArgumentNullException(nameof(projectWorker));
            }

            _foregroundDispatcher = foregroundDispatcher;
            _projectManager       = projectManager;
            _projectWorker        = projectWorker;

            _projects = new Dictionary <ProjectId, Project>();
        }