public void SerializeSerializedProjectInfo(SerializedProjectInfo info, ObjectWriter writer, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            SerializeProjectId(info.Id, writer, cancellationToken);

            // TODO: figure out a way to send version info over as well
            // info.Version.WriteTo(writer);

            writer.WriteString(info.Name);
            writer.WriteString(info.AssemblyName);
            writer.WriteString(info.Language);
            writer.WriteString(info.FilePath);
            writer.WriteString(info.OutputFilePath);
            writer.WriteBoolean(info.IsSubmission);
        }
Beispiel #2
0
        public void Find(
            ProjectState state,
            HashSet <Checksum> searchingChecksumsLeft,
            Dictionary <Checksum, object> result,
            CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            // verify input
            ProjectStateChecksums 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 SerializedProjectInfo(state.Id, state.Version, state.Name, state.AssemblyName, state.Language, state.FilePath, state.OutputFilePath, state.IsSubmission);
            }

            if (searchingChecksumsLeft.Remove(CompilationOptions))
            {
                result[CompilationOptions] = state.CompilationOptions;
            }

            if (searchingChecksumsLeft.Remove(ParseOptions))
            {
                result[ParseOptions] = state.ParseOptions;
            }

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

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

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

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

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

            Find(state.DocumentStates, searchingChecksumsLeft, result, cancellationToken);
            Find(state.ProjectReferences, ProjectReferences, searchingChecksumsLeft, result, cancellationToken);
            Find(state.MetadataReferences, MetadataReferences, searchingChecksumsLeft, result, cancellationToken);
            Find(state.AnalyzerReferences, AnalyzerReferences, searchingChecksumsLeft, result, cancellationToken);
            Find(state.AdditionalDocumentStates, searchingChecksumsLeft, result, cancellationToken);
        }