/// <summary> /// Adds a solution file project reference to the dependencies solution folder of the solution file. /// Acquires the dependencies solution folder if not present, and adds the project nesting entry. /// </summary> public static void AddProjectToDependenciesSolutionFolder(this SolutionFile solutionFile, SolutionFileProjectReference projectReference) { var dependenciesSolutionFolder = solutionFile.AcquireDependenciesSolutionFolder(); var projectNesting = new ProjectNesting { ProjectGUID = projectReference.ProjectGUID, ParentProjectGUID = dependenciesSolutionFolder.ProjectGUID }; solutionFile.AddProjectNesting(projectNesting); }
public static ProjectNesting Deserialize(string line) { var matches = Regex.Matches(line, @"{[^}]*}"); var projectGuidStr = matches[0].Value; var projectParentGuidStr = matches[1].Value; var projectGUID = Guid.Parse(projectGuidStr); var projectParentGuid = Guid.Parse(projectParentGuidStr); var projectNesting = new ProjectNesting { ProjectGUID = projectGUID, ParentProjectGUID = projectParentGuid }; return(projectNesting); }
public static string Serialize(ProjectNesting projectNesting) { var line = projectNesting.ToString(); return(line); }
public static void AddProjectNesting(this SolutionFile solutionFile, ProjectNesting projectNesting) { var nestedProjectsGlobalSection = solutionFile.GlobalSections.AcquireNestedProjectsGlobalSection(); nestedProjectsGlobalSection.ProjectNestings.Add(projectNesting); }