public void AddSolution(Solution solution, SolutionFolder folder = null) { SolutionFolder GetParentFolder(PrimitiveProject solutionFolder) => AllSolutionFolders.FirstOrDefault(x => x.ProjectId == solutionFolder.SolutionFolder?.ProjectId); IDictionary <string, string> GetItems(SolutionFolder solutionFolder) => solutionFolder.Items.Keys .Select(x => (string)PathConstruction.GetWinRelativePath(Directory, solution.Directory / x)) .ToDictionary(x => x, x => x); solution.AllSolutionFolders.ForEach(x => AddSolutionFolder(x.Name, x.ProjectId, GetParentFolder(x) ?? folder)); solution.AllSolutionFolders.ForEach(x => GetSolutionFolder(x.ProjectId).Items = GetItems(x)); solution.AllProjects.ForEach(x => AddProject(x.Name, x.TypeId, x.Path, x.ProjectId, x.Configurations, GetParentFolder(x) ?? folder)); }
public SolutionFolder GetSolutionFolder(string name) { return(AllSolutionFolders.SingleOrDefault(x => name.Equals(x.Name, StringComparison.Ordinal))); }
public SolutionFolder GetSolutionFolder(Guid projectId) { return(AllSolutionFolders.Single(x => x.ProjectId == projectId)); }
public void RandomizeProjectIds() { AllSolutionFolders.ForEach(x => x.ProjectId = Guid.NewGuid()); AllProjects.ForEach(x => x.ProjectId = Guid.NewGuid()); }