public void SerializeSerializedSolutionInfo(SerializedSolutionInfo info, ObjectWriter writer, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            SerializeSolutionId(info.Id, writer, cancellationToken);

            // TODO: figure out a way to send version info over as well.
            //       right now, version get updated automatically, so 2 can't be exactly match
            // info.Version.WriteTo(writer);
            writer.WriteString(info.FilePath);
        }
Exemple #2
0
        public void Find(
            SolutionState state,
            HashSet <Checksum> searchingChecksumsLeft,
            Dictionary <Checksum, object> result,
            CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            // verify input
            SolutionStateChecksums stateChecksum;

            Contract.ThrowIfFalse(state.TryGetStateChecksums(out stateChecksum));
            Contract.ThrowIfFalse(this == stateChecksum);

            if (searchingChecksumsLeft.Remove(Checksum))
            {
                result[Checksum] = this;
            }

            if (searchingChecksumsLeft.Remove(Info))
            {
                result[Info] = new SerializedSolutionInfo(state.Id, state.Version, state.FilePath);
            }

            if (searchingChecksumsLeft.Remove(Projects.Checksum))
            {
                result[Projects.Checksum] = Projects;
            }

            foreach (var kv in state.ProjectStates)
            {
                var projectState = kv.Value;

                // solution state checksum can't be created without project state checksums created first
                ProjectStateChecksums projectStateChecksums;
                Contract.ThrowIfFalse(projectState.TryGetStateChecksums(out projectStateChecksums));

                projectStateChecksums.Find(projectState, searchingChecksumsLeft, result, cancellationToken);
                if (searchingChecksumsLeft.Count == 0)
                {
                    return;
                }
            }
        }