Esempio n. 1
0
        public int GetRootChangesList(out object ppIUnknownPreviewChangesList)
        {
            var changes        = _newSolution.GetChanges(_oldSolution);
            var projectChanges = changes.GetProjectChanges();

            _topLevelChange = new TopLevelChange(_topLevelName, _topLevelGlyph, _newSolution, _oldSolution, _componentModel, this);

            var builder = ArrayBuilder <AbstractChange> .GetInstance();

            // Documents
            var changedDocuments = projectChanges.SelectMany(p => p.GetChangedDocuments());
            var addedDocuments   = projectChanges.SelectMany(p => p.GetAddedDocuments());
            var removedDocuments = projectChanges.SelectMany(p => p.GetRemovedDocuments());

            var allDocumentsWithChanges = new List <DocumentId>();

            allDocumentsWithChanges.AddRange(changedDocuments);
            allDocumentsWithChanges.AddRange(addedDocuments);
            allDocumentsWithChanges.AddRange(removedDocuments);

            // Additional Documents
            var changedAdditionalDocuments = projectChanges.SelectMany(p => p.GetChangedAdditionalDocuments());
            var addedAdditionalDocuments   = projectChanges.SelectMany(p => p.GetAddedAdditionalDocuments());
            var removedAdditionalDocuments = projectChanges.SelectMany(p => p.GetRemovedAdditionalDocuments());

            allDocumentsWithChanges.AddRange(changedAdditionalDocuments);
            allDocumentsWithChanges.AddRange(addedAdditionalDocuments);
            allDocumentsWithChanges.AddRange(removedAdditionalDocuments);

            AppendFileChanges(allDocumentsWithChanges, builder);

            // References (metadata/project/analyzer)
            ReferenceChange.AppendReferenceChanges(projectChanges, this, builder);

            _topLevelChange.Children     = new ChangeList(builder.ToArray());
            ppIUnknownPreviewChangesList = new ChangeList(new[] { _topLevelChange });
            return(VSConstants.S_OK);
        }
Esempio n. 2
0
        public int GetRootChangesList(out object ppIUnknownPreviewChangesList)
        {
            var changes = _newSolution.GetChanges(_oldSolution);
            var projectChanges = changes.GetProjectChanges();

            _topLevelChange = new TopLevelChange(_topLevelName, _topLevelGlyph, _newSolution, _oldSolution, _componentModel, this);

            var builder = ArrayBuilder<AbstractChange>.GetInstance();

            // Documents
            var changedDocuments = projectChanges.SelectMany(p => p.GetChangedDocuments());
            var addedDocuments = projectChanges.SelectMany(p => p.GetAddedDocuments());
            var removedDocuments = projectChanges.SelectMany(p => p.GetRemovedDocuments());

            var allDocumentsWithChanges = new List<DocumentId>();
            allDocumentsWithChanges.AddRange(changedDocuments);
            allDocumentsWithChanges.AddRange(addedDocuments);
            allDocumentsWithChanges.AddRange(removedDocuments);

            // Additional Documents
            var changedAdditionalDocuments = projectChanges.SelectMany(p => p.GetChangedAdditionalDocuments());
            var addedAdditionalDocuments = projectChanges.SelectMany(p => p.GetAddedAdditionalDocuments());
            var removedAdditionalDocuments = projectChanges.SelectMany(p => p.GetRemovedAdditionalDocuments());

            allDocumentsWithChanges.AddRange(changedAdditionalDocuments);
            allDocumentsWithChanges.AddRange(addedAdditionalDocuments);
            allDocumentsWithChanges.AddRange(removedAdditionalDocuments);

            AppendFileChanges(allDocumentsWithChanges, builder);

            // References (metadata/project/analyzer)
            ReferenceChange.AppendReferenceChanges(projectChanges, this, builder);

            _topLevelChange.Children = new ChangeList(builder.ToArray());
            ppIUnknownPreviewChangesList = new ChangeList(new[] { _topLevelChange });
            return VSConstants.S_OK;
        }