public RootTreeNode(ChecksumTreeCollection owner, SolutionState solutionState) : base(owner, GetOrCreateSerializer(solutionState.Workspace.Services)) { SolutionState = solutionState; _checksumObjectFromAdditionalAssetsGetter = GetChecksumObjectFromAdditionalAssets; }
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); }
public ChecksumScope( ChecksumTreeCollection trees, IRootChecksumTreeNode tree, SolutionChecksumObject solutionChecksum) { _trees = trees; _tree = tree; SolutionChecksum = solutionChecksum; _trees.RegisterSnapshot(this, tree); }
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); }
private Task <ChecksumCollection> GetEmptyChecksumCollectionTask(string kind) { return(ChecksumTreeCollection.GetOrCreateEmptyChecksumCollectionTask(_serializer, kind)); }
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; }
public AssetOnlyTreeNode(Solution solution) { Serializer = ChecksumTreeCollection.GetOrCreateSerializer(solution.Workspace.Services); }
public Service(HostWorkspaceServices workspaceServices, ChecksumTreeCollection trees) { _workspaceServices = workspaceServices; _treeCollection = trees; }