Example #1
0
        public PartPage(SectionPart part, Inspection inspection, SectionWithPartsPage sectionPage)
        {
            this.part       = part;
            this.inspection = inspection;
            Title           = "Part " + part.Label;
            Icon            = "TabIconGreenNoBG.png";
            List <QuestionPage> pages = InspectionHelper.GenerateQuestionPages(part.Questions, inspection, sectionPage);

            foreach (ContentPage page in pages)
            {
                Children.Add(page);
            }
            UpdateIcon(true);
            this.CurrentPageChanged += PartPage_CurrentPageChanged;
        }
Example #2
0
        public PartPage(SectionPart part, Inspection inspection, SectionWithPartsPage sectionPage)
        {
            this.part       = part;
            this.inspection = inspection;
            parentPage      = sectionPage;
            Title           = "Part " + part.Label;
            List <QuestionPage> pages = InspectionHelper.GenerateQuestionPages(part.Questions, inspection, sectionPage);

            foreach (ContentPage page in pages)
            {
                Children.Add(page);
            }
            //InspectionHelper.InitializePages(pages);
            UpdateIcon();
            this.CurrentPageChanged += PartPage_CurrentPageChanged;
        }
Example #3
0
        protected void ParseSectionParts(XmlNode node, SectionModel section)
        {
            // create new part
            SectionPart part = new SectionPart();

            part.Label        = AttributeString(node.Attributes["Label"]);
            part.Description  = AttributeString(node.Attributes["Description"]);
            part.ScoringModel = AttributeString(node.Attributes["ScoringModel"], "YesNo");

            // add part to the given part list
            section.SectionParts.Add(part);
            part.section   = section;
            part.SectionId = section.Id;

            // loop through child nodes
            for (int i = 0; i < node.ChildNodes.Count; i++)
            {
                XmlNode child = node.ChildNodes[i];

                if (child.NodeType != XmlNodeType.Element)
                {
                    continue;
                }

                if (child.Name == "Question")
                {
                    ParseQuestions(child, part.Questions);
                    foreach (Question question in part.Questions)
                    {
                        question.part    = part;
                        question.section = section;
                        section.Questions.Add(question);                         //I don't really like doing this, but the linkage really ought to be there.
                        //Note, you usually aren't supposed to call "Section.Questions".
                    }
                }
                //else
                //UnknownNode(child);
            }
        }