コード例 #1
0
        private void UpdateDependenciesSnapshotAsync(
            ImmutableDictionary <ITargetFramework, IDependenciesChanges> changes,
            IProjectCatalogSnapshot catalogs,
            ITargetFramework activeTargetFramework)
        {
            DependenciesSnapshot newSnapshot;
            bool anyChanges = false;

            HashSet <string> projectItemSpecs = GetProjectItemSpecsFromSnapshot(catalogs);

            // Note: we are updating existing snapshot, not receivig a complete new one. Thus we must
            // ensure incremental updates are done in the correct order. This lock ensures that here.
            lock (_snapshotLock)
            {
                newSnapshot = DependenciesSnapshot.FromChanges(
                    CommonServices.Project.FullPath,
                    _currentSnapshot,
                    changes,
                    catalogs,
                    activeTargetFramework,
                    SnapshotFilters.Select(x => x.Value),
                    SubTreeProviders.Select(x => x.Value),
                    projectItemSpecs,
                    out anyChanges);
                _currentSnapshot = newSnapshot;
            }

            if (anyChanges)
            {
                // avoid unnecessary tree updates
                ScheduleDependenciesUpdate();
            }
        }
 IEnumerable <IProjectDependenciesSubTreeProvider> IDependenciesGraphProjectContext.GetProviders()
 {
     return(SubTreeProviders.Select(x => x.Value).ToList());
 }