コード例 #1
0
        /// <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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        public static string Serialize(ProjectNesting projectNesting)
        {
            var line = projectNesting.ToString();

            return(line);
        }
コード例 #4
0
        public static void AddProjectNesting(this SolutionFile solutionFile, ProjectNesting projectNesting)
        {
            var nestedProjectsGlobalSection = solutionFile.GlobalSections.AcquireNestedProjectsGlobalSection();

            nestedProjectsGlobalSection.ProjectNestings.Add(projectNesting);
        }