SerializedInfos.cs 2.9 KB
Newer Older
1 2 3 4
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using System.Collections.Generic;

5
namespace Microsoft.CodeAnalysis.Serialization
6 7
{
    /// <summary>
8
    /// types to hold information in solution info/project info or document info that remote host will have as well.
9 10 11 12 13 14
    /// 
    /// TODO: right now, any kind of version is not synced to remote host since it requires some changes in workspace.
    ///       but we should sync versions to remote host as well when we make workspace available in remote host.
    ///       for now, even if remote host uses workspace for things like resolving p2p references, only public service
    ///       clients can use are APIs compiler layer expose.
    /// </summary>
15
    internal sealed class SerializedSolutionInfo
16 17 18 19 20
    {
        public readonly SolutionId Id;
        public readonly VersionStamp Version;
        public readonly string FilePath;

21
        public SerializedSolutionInfo(SolutionId id, VersionStamp version, string filePath)
22 23 24 25 26 27 28
        {
            Id = id;
            Version = version;
            FilePath = filePath;
        }
    }

29
    internal sealed class SerializedProjectInfo
30 31
    {
        // REVIEW: do we need this?
32
        // HostObjectType, HasAllInformation, Top Level Version, Latest Document Version
33 34 35 36 37 38 39 40

        public readonly ProjectId Id;
        public readonly VersionStamp Version;
        public readonly string Name;
        public readonly string AssemblyName;
        public readonly string Language;
        public readonly string FilePath;
        public readonly string OutputFilePath;
41
        public readonly bool IsSubmission;
42

43
        public SerializedProjectInfo(ProjectId id, VersionStamp version, string name, string assemblyName, string language, string filePath, string outputFilePath, bool isSubmission)
44 45 46 47 48 49 50 51
        {
            Id = id;
            Version = version;
            Name = name;
            AssemblyName = assemblyName;
            Language = language;
            FilePath = filePath;
            OutputFilePath = outputFilePath;
52
            IsSubmission = isSubmission;
53 54 55
        }
    }

56
    internal sealed class SerializedDocumentInfo
57 58 59 60 61 62 63 64 65 66 67
    {
        // REVIEW: do we need this?
        // Tree Version, Text Version

        public readonly DocumentId Id;
        public readonly string Name;
        public readonly IReadOnlyList<string> Folders;
        public readonly SourceCodeKind SourceCodeKind;
        public readonly string FilePath;
        public readonly bool IsGenerated;

68
        public SerializedDocumentInfo(DocumentId id, string name, IReadOnlyList<string> folders, SourceCodeKind sourceCodeKind, string filePath, bool isGenerated)
69 70 71 72 73 74 75 76 77
        {
            Id = id;
            Name = name;
            Folders = folders;
            SourceCodeKind = sourceCodeKind;
            FilePath = filePath;
            IsGenerated = isGenerated;
        }
    }
78
}