diff options
Diffstat (limited to 'modules/mono/editor/GodotTools/GodotTools.ProjectEditor/DotNetSolution.cs')
-rw-r--r-- | modules/mono/editor/GodotTools/GodotTools.ProjectEditor/DotNetSolution.cs | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/DotNetSolution.cs b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/DotNetSolution.cs index 355b21d63a..ff15b96c1c 100644 --- a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/DotNetSolution.cs +++ b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/DotNetSolution.cs @@ -34,22 +34,23 @@ EndProject"; @" {{{0}}}.{1}|Any CPU.ActiveCfg = {1}|Any CPU {{{0}}}.{1}|Any CPU.Build.0 = {1}|Any CPU"; - private string _directoryPath; private readonly Dictionary<string, ProjectInfo> _projects = new Dictionary<string, ProjectInfo>(); public string Name { get; } - - public string DirectoryPath - { - get => _directoryPath; - set => _directoryPath = value.IsAbsolutePath() ? value : Path.GetFullPath(value); - } + public string DirectoryPath { get; } public class ProjectInfo { - public string Guid; - public string PathRelativeToSolution; - public List<string> Configs = new List<string>(); + public string Guid { get; } + public string PathRelativeToSolution { get; } + public List<string> Configs { get; } + + public ProjectInfo(string guid, string pathRelativeToSolution, List<string> configs) + { + Guid = guid; + PathRelativeToSolution = pathRelativeToSolution; + Configs = configs; + } } public void AddNewProject(string name, ProjectInfo projectInfo) @@ -117,9 +118,10 @@ EndProject"; File.WriteAllText(solutionPath, content, Encoding.UTF8); // UTF-8 with BOM } - public DotNetSolution(string name) + public DotNetSolution(string name, string directoryPath) { Name = name; + DirectoryPath = directoryPath.IsAbsolutePath() ? directoryPath : Path.GetFullPath(directoryPath); } public static void MigrateFromOldConfigNames(string slnPath) |