Example #1
0
 // ReSharper disable UnusedMember.Local
 // ReSharper disable UnusedParameter.Local
 private static void ParseProjectSection_(Solution solution, _SolutionItem solutionItem, TextReader textReader)
 {
     for (string line = textReader.ReadLine()?.Trim(); line != null; line = textReader.ReadLine()?.Trim())
     {
         if (line == "EndProjectSection")
         {
             return;
         }
     }
     throw new ParseException("Unexpected end of file");
 }
Example #2
0
        private static void ParseProjectSection_SolutionItems(Solution solution, _SolutionItem solutionItem, TextReader textReader)
        {
            if (!(solutionItem is ProjectFolder projectFolder))
            {
                return;
            }

            for (string line = textReader.ReadLine()?.Trim(); line != null; line = textReader.ReadLine()?.Trim())
            {
                if (line == "EndProjectSection")
                {
                    return;
                }

                // ReSharper disable once UnusedVariable
                SplitValues(line, out string value1, out string value2);

                projectFolder.AddChild(new SolutionItem(solution, value1));
            }
            throw new ParseException("Unexpected end of file");
        }
Example #3
0
        // ReSharper restore UnusedParameter.Local

        private static void ParseProjectSection_ProjectDependencies(Solution solution, _SolutionItem solutionItem, TextReader textReader)
        {
            if (!(solutionItem is Project project))
            {
                return;
            }

            for (string line = textReader.ReadLine()?.Trim(); line != null; line = textReader.ReadLine()?.Trim())
            {
                if (line == "EndProjectSection")
                {
                    return;
                }

                // ReSharper disable once UnusedVariable
                SplitValues(line, out string value1, out string value2);

                project.DependentProjects.Add(solution.FindProject(new Guid(value1)));
            }
            throw new ParseException("Unexpected end of file");
        }
Example #4
0
        private static void ParseProjectSections(Solution solution, TextReader textReader, _SolutionItem solutionItem)
        {
            for (string line = textReader.ReadLine()?.Trim(); line != null; line = textReader.ReadLine()?.Trim())
            {
                if (line == "")
                {
                    continue;
                }

                if (line == "EndProject")
                {
                    return;
                }

                Match M = rxProjectSection.Match(line);
                if (M.Success && FindProjectSectionHandler(M.Groups["Name"].Value, out MethodInfo sectionHandler))
                {
                    sectionHandler.Invoke(solution, new object[] { solution, solutionItem, textReader });
                    continue;
                }

                throw new ParseException($"Unexpected line: {line}");
            }
            throw new ParseException("Unexpected end of file");
        }
Example #5
0
 internal void AddChild(_SolutionItem child)
 {
     _Children.Add(child);
     child.Parent = this;
 }