Esempio n. 1
0
        public bool ParseNextLine(string line)
        {
            if (sectionDefinition != null && LastProcessingStatus == State.InProgress)
            {
                if (line == sectionEndTag)
                {
                    LastProcessingStatus             = State.Succeeded;
                    LastSuccessfullyProcessedSection = sectionDefinition;
                    sectionDefinition = null;
                    return(false);
                }

                KeyValuePair <string, string> result;
                if (LineParserHelper.TryParseKeyValuePair(line, out result))
                {
                    sectionDefinition.Properties[result.Key] = result.Value;
                    return(true);
                }

                LastProcessingStatus = State.Failed;
            }

            sectionDefinition = null;
            return(false);
        }
Esempio n. 2
0
        public static Dictionary <string, SectionDefinition> CreateGlobal(IEnumerable <ProjectDefinition> projects)
        {
            SectionDefinition solutionConfigurationPlatformSection = CreateGlobalSection("preSolution",
                                                                                         ("Debug|Any CPU", "Debug|Any CPU"),
                                                                                         ("Release|Any CPU", "Release|Any CPU"));

            return(new Dictionary <string, SectionDefinition>
            {
Esempio n. 3
0
        public bool TryParseFirstLine(string line)
        {
            KeyValuePair <string, string> result;

            if (!line.StartsWith(sectionBeginTag) || !LineParserHelper.TryParseSectionLine(line, out result))
            {
                return(false);
            }

            sectionDefinition    = new SectionDefinition(result.Key, result.Value);
            LastProcessingStatus = State.InProgress;
            return(true);
        }
Esempio n. 4
0
 public void StartSection(string sectionId, string initializeType)
 {
     InnerProjectSections[sectionId] = new SectionDefinition(sectionId, initializeType);
 }
Esempio n. 5
0
 public void AddGlobalSection(SectionDefinition globalSection)
 {
     solutionFile.Global.Add(globalSection);
 }