Пример #1
0
            public RootTreeNode(ChecksumTreeCollection owner, SolutionState solutionState) :
                base(owner, GetOrCreateSerializer(solutionState.Workspace.Services))
            {
                SolutionState = solutionState;

                _checksumObjectFromAdditionalAssetsGetter = GetChecksumObjectFromAdditionalAssets;
            }
Пример #2
0
            public SubTreeNode(ChecksumTreeCollection owner, Serializer serializer)
            {
                _owner = owner;
                _cache = new ConcurrentDictionary <object, ChecksumObjectCache>(concurrencyLevel: 2, capacity: 1);

                Serializer = serializer;
            }
            public SubTreeNode GetOrCreateSubTreeNode(ChecksumTreeCollection owner, Serializer serializer)
            {
                if (_lazyChecksumTree == null)
                {
                    Interlocked.CompareExchange(ref _lazyChecksumTree, new SubTreeNode(owner, serializer), null);
                }

                return(_lazyChecksumTree);
            }
Пример #4
0
        public ChecksumScope(
            ChecksumTreeCollection trees,
            IRootChecksumTreeNode tree,
            SolutionChecksumObject solutionChecksum)
        {
            _trees = trees;
            _tree = tree;

            SolutionChecksum = solutionChecksum;

            _trees.RegisterSnapshot(this, tree);
        }
Пример #5
0
        public ChecksumScope(
            ChecksumTreeCollection trees,
            IRootChecksumTreeNode tree,
            SolutionChecksumObject solutionChecksum)
        {
            _trees = trees;
            _tree = tree;

            SolutionChecksum = solutionChecksum;

            _trees.RegisterSnapshot(this, tree);
        }
Пример #6
0
        public async Task MetadataReference_RoundTrip_Test()
        {
            var hostServices = MefHostServices.Create(
                MefHostServices.DefaultAssemblies.Add(typeof(Host.TemporaryStorageServiceFactory.TemporaryStorageService).Assembly));

            var workspace = new AdhocWorkspace(hostServices);
            var reference = MetadataReference.CreateFromFile(typeof(object).Assembly.Location);

            var serializer = new Serializer(workspace.Services);
            var trees = new ChecksumTreeCollection();
            var assetBuilder = new AssetBuilder(trees.CreateRootTreeNode(workspace.CurrentSolution.State));

            var assetFromFile = assetBuilder.Build(reference, CancellationToken.None);
            var assetFromStorage = await CloneMetadataReferenceAssetAsync(serializer, assetBuilder, assetFromFile).ConfigureAwait(false);
            var assetFromStorage2 = await CloneMetadataReferenceAssetAsync(serializer, assetBuilder, assetFromStorage).ConfigureAwait(false);
        }
Пример #7
0
 private Task <ChecksumCollection> GetEmptyChecksumCollectionTask(string kind)
 {
     return(ChecksumTreeCollection.GetOrCreateEmptyChecksumCollectionTask(_serializer, kind));
 }
Пример #8
0
 private ChecksumCollection GetEmptyChecksumCollection(string kind)
 {
     return(ChecksumTreeCollection.GetOrCreateEmptyChecksumCollection(_serializer, kind));
 }
        public async Task Missing_Analyzer_Serailization_Desktop_Test()
        {
            var hostServices = MefHostServices.Create(
                MefHostServices.DefaultAssemblies.Add(typeof(Host.TemporaryStorageServiceFactory.TemporaryStorageService).Assembly));

            var workspace = new AdhocWorkspace(hostServices);
            var reference = new AnalyzerFileReference("missing_reference", new MissingAnalyzerLoader());

            var serializer = new Serializer(workspace.Services);
            var trees = new ChecksumTreeCollection();
            var assetBuilder = new AssetBuilder(trees.CreateRootTreeNode(workspace.CurrentSolution.State));

            // make sure this doesn't throw
            var assetFromFile = assetBuilder.Build(reference, CancellationToken.None);
            var assetFromStorage = await CloneAssetAsync(serializer, assetBuilder, assetFromFile).ConfigureAwait(false);
            var assetFromStorage2 = await CloneAssetAsync(serializer, assetBuilder, assetFromStorage).ConfigureAwait(false);
        }
        public async Task Missing_Metadata_Serailization_Test()
        {
            var workspace = new AdhocWorkspace();
            var reference = new MissingMetadataReference();

            var serializer = new Serializer(workspace.Services);
            var trees = new ChecksumTreeCollection();
            var assetBuilder = new AssetBuilder(trees.CreateRootTreeNode(workspace.CurrentSolution.State));

            // make sure this doesn't throw
            var assetFromFile = assetBuilder.Build(reference, CancellationToken.None);
            var assetFromStorage = await CloneAssetAsync(serializer, assetBuilder, assetFromFile).ConfigureAwait(false);
            var assetFromStorage2 = await CloneAssetAsync(serializer, assetBuilder, assetFromStorage).ConfigureAwait(false);
        }
            public SubTreeNode GetOrCreateSubTreeNode(ChecksumTreeCollection owner, Serializer serializer)
            {
                if (_lazyChecksumTree != null)
                {
                    return _lazyChecksumTree;
                }

                Interlocked.CompareExchange(ref _lazyChecksumTree, new SubTreeNode(owner, serializer), null);
                return _lazyChecksumTree;
            }
 public RootTreeNode(ChecksumTreeCollection owner, SolutionState solutionState) :
     base(owner, GetOrCreateSerializer(solutionState.Workspace.Services))
 {
     SolutionState = solutionState;
 }
Пример #13
0
 public AssetOnlyTreeNode(Solution solution)
 {
     Serializer = ChecksumTreeCollection.GetOrCreateSerializer(solution.Workspace.Services);
 }
Пример #14
0
 public Service(HostWorkspaceServices workspaceServices, ChecksumTreeCollection trees)
 {
     _workspaceServices = workspaceServices;
     _treeCollection = trees;
 }