public ValidationReport Validate(StyleSheet styleSheet, QuestionForm form) { if (styleSheet == null) { throw new ArgumentNullException("styleSheet"); } if (form == null) { throw new ArgumentNullException("form"); } var validators = new List <ASTChecker> { new QuestionReferencingChecker(form.GetAllQuestions()), new StyleAttributeChecker(), new WidgetTypeChecker(form.GetAllQuestions()) }; var report = new ValidationReport(); foreach (var validator in validators) { validator.Validate(styleSheet, report); } return(report); }
public QuestionStyleCollection GetQuestionStyles(StyleSheet styleSheet, QuestionForm form) { if (styleSheet == null) { throw new ArgumentNullException("styleSheet"); } if (form == null) { throw new ArgumentNullException("form"); } var styleEvaluator = new QuestionStyleEvaluator(); return styleEvaluator.GetQuestionStyles(styleSheet, form.GetAllQuestions()); }
public ValidationReport Validate(StyleSheet styleSheet, QuestionForm form) { if (styleSheet == null) { throw new ArgumentNullException("styleSheet"); } if (form == null) { throw new ArgumentNullException("form"); } var validators = new List<ASTChecker> { new QuestionReferencingChecker(form.GetAllQuestions()), new StyleAttributeChecker(), new WidgetTypeChecker(form.GetAllQuestions()) }; var report = new ValidationReport(); foreach (var validator in validators) { validator.Validate(styleSheet, report); } return report; }
public QuestionStyleCollection GetQuestionStyles(StyleSheet styleSheet, QuestionForm form) { if (styleSheet == null) { throw new ArgumentNullException("styleSheet"); } if (form == null) { throw new ArgumentNullException("form"); } var styleEvaluator = new QuestionStyleEvaluator(); return(styleEvaluator.GetQuestionStyles(styleSheet, form.GetAllQuestions())); }
public override Control VisitQuestionReference(QuestionReference questionRef) { var question = _questionForm.GetAllQuestions().Where(q => q.Name == questionRef.Name).SingleOrDefault(); if (question != null) { StyleSet questionStyles = _questionStyles.GetStyleSet(question.Name); QuestionWidget questionWidget = (QuestionWidget)questionStyles.WidgetStyle.CreateWidgetControl(new WidgetFactory(question)); questionWidget.ApplyStyles(questionStyles); _questionWidgets.Add(questionWidget); return(questionWidget); } else { throw new ApplicationException("Question not found in the questionnaire AST."); } }