Ejemplo n.º 1
0
        private async Task SynchronizeDocumentsAsync(SolutionStateChecksums solutionChecksumObject, CancellationToken cancellationToken)
        {
            // get children of document checksum objects at once
            using (var pooledObject = SharedPools.Default <HashSet <Checksum> >().GetPooledObject())
            {
                var documentChecksums = pooledObject.Object;

                foreach (var projectChecksum in solutionChecksumObject.Projects)
                {
                    var projectChecksumObject = await _assetService.GetAssetAsync <ProjectStateChecksums>(projectChecksum, cancellationToken).ConfigureAwait(false);

                    foreach (var checksum in projectChecksumObject.Documents)
                    {
                        var documentChecksumObject = await _assetService.GetAssetAsync <DocumentStateChecksums>(checksum, cancellationToken).ConfigureAwait(false);

                        AddIfNeeded(documentChecksums, documentChecksumObject.Children);
                    }

                    foreach (var checksum in projectChecksumObject.AdditionalDocuments)
                    {
                        var documentChecksumObject = await _assetService.GetAssetAsync <DocumentStateChecksums>(checksum, cancellationToken).ConfigureAwait(false);

                        AddIfNeeded(documentChecksums, documentChecksumObject.Children);
                    }
                }

                await _assetService.SynchronizeAssetsAsync(documentChecksums, cancellationToken).ConfigureAwait(false);
            }
        }
Ejemplo n.º 2
0
        private async Task SynchronizeSolutionAsync(SolutionStateChecksums solutionChecksumObject, CancellationToken cancellationToken)
        {
            // get children of solution checksum object at once
            using (var pooledObject = SharedPools.Default<HashSet<Checksum>>().GetPooledObject())
            {
                var solutionChecksums = pooledObject.Object;

                AddIfNeeded(solutionChecksums, solutionChecksumObject.Children);
                await _assetService.SynchronizeAssetsAsync(solutionChecksums, cancellationToken).ConfigureAwait(false);
            }
        }
Ejemplo n.º 3
0
        private async Task SynchronizeSolutionAsync(SolutionStateChecksums solutionChecksumObject, CancellationToken cancellationToken)
        {
            // get children of solution checksum object at once
            using (var pooledObject = SharedPools.Default <HashSet <Checksum> >().GetPooledObject())
            {
                var solutionChecksums = pooledObject.Object;

                AddIfNeeded(solutionChecksums, solutionChecksumObject.Children);
                await _assetService.SynchronizeAssetsAsync(solutionChecksums, cancellationToken).ConfigureAwait(false);
            }
        }
Ejemplo n.º 4
0
        internal static async Task VerifyAssetAsync(IRemotableDataService service, SolutionStateChecksums solutionObject)
        {
            await VerifyAssetSerializationAsync <SolutionInfo.SolutionAttributes>(
                service, solutionObject.Info, WellKnownSynchronizationKind.SolutionAttributes,
                (v, k, s) => SolutionAsset.Create(s.CreateChecksum(v, CancellationToken.None), v, s)).ConfigureAwait(false);

            foreach (var projectChecksum in solutionObject.Projects)
            {
                var projectObject = await service.GetValueAsync <ProjectStateChecksums>(projectChecksum).ConfigureAwait(false);
                await VerifyAssetAsync(service, projectObject).ConfigureAwait(false);
            }
        }
Ejemplo n.º 5
0
        internal static void SolutionStateEqual(IRemotableDataService service, SolutionStateChecksums solutionObject1, SolutionStateChecksums solutionObject2)
        {
            ChecksumWithChildrenEqual(solutionObject1, solutionObject2);

            ProjectStatesEqual(service, solutionObject1.Projects.ToProjectObjects(service), solutionObject2.Projects.ToProjectObjects(service));
        }
Ejemplo n.º 6
0
 public bool TryGetStateChecksums(out SolutionStateChecksums stateChecksums)
 {
     return(_lazyChecksums.TryGetValue(out stateChecksums));
 }
Ejemplo n.º 7
0
        private async Task SynchronizeProjectsAsync(SolutionStateChecksums solutionChecksumObject, CancellationToken cancellationToken)
        {
            // get children of project checksum objects at once
            using (var pooledObject = SharedPools.Default<HashSet<Checksum>>().GetPooledObject())
            {
                var projectChecksums = pooledObject.Object;

                foreach (var projectChecksum in solutionChecksumObject.Projects)
                {
                    var projectChecksumObject = await _assetService.GetAssetAsync<ProjectStateChecksums>(projectChecksum, cancellationToken).ConfigureAwait(false);
                    AddIfNeeded(projectChecksums, projectChecksumObject.Children);
                }

                await _assetService.SynchronizeAssetsAsync(projectChecksums, cancellationToken).ConfigureAwait(false);
            }
        }
Ejemplo n.º 8
0
 public bool TryGetStateChecksums(out SolutionStateChecksums stateChecksums)
 => _lazyChecksums.TryGetValue(out stateChecksums);
Ejemplo n.º 9
0
 public bool TryGetStateChecksums(out SolutionStateChecksums stateChecksums)
 {
     return _lazyChecksums.TryGetValue(out stateChecksums);
 }