Example #1
0
        private void Visit(AST.Section section)
        {
            foreach (var question in section.Questions)
            {
                Visit((dynamic)question);
            }

            foreach (var style in section.Styles)
            {
                Visit((dynamic)style);
            }

            foreach (var innerSection in section.Sections)
            {
                Visit((dynamic)innerSection);
            }
        }
Example #2
0
        private RunTime.DocumentModel.Section Process(AST.Section section)
        {
            /* Push the default styles of this section onto the stack
             * so child sections/questions can use them */
            AddStylesToStack(section.Styles);

            var sectionContainer = new RunTime.DocumentModel.Section(section.Name);

            foreach (var question in section.Questions)
            {
                sectionContainer.AddQuestion(Process((dynamic)question));
            }

            foreach (var sec in section.Sections)
            {
                sectionContainer.AddQuestion(Process((dynamic)sec));
            }

            RemoveStylesFromStack(section.Styles);
            return(sectionContainer);
        }