Ejemplo n.º 1
0
        private SolutionFolder ReadProjectEntry(Solution parent, Match match)
        {
            string         path = match.Groups["HintPath"].Value;
            SolutionFolder entry;

            Guid typeID = Guid.Parse(match.Groups["TypeGuid"].Value);

            if (typeID == SolutionFolder.SolutionFolderGuid)
            {
                entry = new SolutionFolder();
            }
            else
            {
                entry = new ProjectEntry();
            }

            entry.TypeGuid   = typeID;
            entry.Name       = match.Groups["Name"].Value;
            entry.FilePath   = new FilePath(parent.FilePath.ParentDirectory.FullPath, match.Groups["HintPath"].Value);
            entry.ObjectGuid = Guid.Parse(match.Groups["ProjectGuid"].Value);

            ReadNextLine();

            Match sectionMatch;

            while (IsAtSection(out sectionMatch))
            {
                entry.Sections.Add(ReadSection(sectionMatch));
                ReadNextLine();
            }

            if (_currentLine != "EndProject")
            {
                ThrowSyntaxError("Expected \"EndProject\" keyword.");
            }

            return(entry);
        }
        private SolutionFolder ReadProjectEntry(Solution parent, Match match)
        {
            string path = match.Groups["HintPath"].Value;
            SolutionFolder entry;

            Guid typeID = Guid.Parse(match.Groups["TypeGuid"].Value);

            if (typeID == SolutionFolder.SolutionFolderGuid)
            {
                entry = new SolutionFolder();
            }
            else
            {
                entry = new ProjectEntry();
            }

            entry.TypeGuid = typeID;
            entry.Name = match.Groups["Name"].Value;
            entry.FilePath = new FilePath(parent.FilePath.ParentDirectory.FullPath, match.Groups["HintPath"].Value);
            entry.ObjectGuid = Guid.Parse(match.Groups["ProjectGuid"].Value);

            ReadNextLine();

            Match sectionMatch;
            while (IsAtSection(out sectionMatch))
            {
                entry.Sections.Add(ReadSection(sectionMatch));
                ReadNextLine();
            }
            
            if (_currentLine != "EndProject")
                ThrowSyntaxError("Expected \"EndProject\" keyword.");

            return entry;
        }