Beispiel #1
0
 public CalendarWidget(Question astQuestion)
     : base(astQuestion)
 {
     InitializeComponent();
     QuestionLabel.Text = Question.Label;
     AnswerDatePicker.Enabled = !astQuestion.IsComputed;
 }
Beispiel #2
0
 public CheckBoxWidget(Question astQuestion)
     : base(astQuestion)
 {
     InitializeComponent();
     QuestionLabel.Text = Question.Label;
     YesCheckBox.Enabled = !astQuestion.IsComputed;
 }
Beispiel #3
0
 public RadioWidget(Question astQuestion)
     : base(astQuestion)
 {
     InitializeComponent();
     QuestionLabel.Text = Question.Label;
     TrueButton.Enabled = !astQuestion.IsComputed;
     FalseButton.Enabled = !astQuestion.IsComputed;
 }
Beispiel #4
0
 public TextBoxWidget(Question astQuestion)
     : base(astQuestion)
 {
     InitializeComponent();
     QuestionLabel.Text = Question.Label;
     AnswerTextBox.Enabled = !astQuestion.IsComputed;
     AnswerTextBox.Text = Question.DataType == DataType.Integer ? "0" : String.Empty;
 }
 private object VisitQuestion(Question question)
 {
     if (LabelExists(question))
     {
         Report.AddWarning(question.Position, "Question '{0}' has a duplicate label.", question.Id.Name);
     }
     _questions.Add(question);
     return null;
 }
 private bool LabelExists(Question question)
 {
     return _questions.Any(q => q.Label == question.Label);
 }
 private object VisitQuestion(Question question)
 {
     if (!_declaredQuestions.Contains(question.Id.Name))
     {
         _declaredQuestions.Add(question.Id.Name);
     }
     else
     {
         Report.AddError(question.Position, "A question with the name '{0}' is already defined in the same scope.", question.Id.Name);
     }
     return null;
 }
Beispiel #8
0
 protected QuestionWidget(Question astQuestion)
     : this()
 {
     Question = astQuestion;
 }
Beispiel #9
0
 public RadioWidget(Question astQuestion, string trueLabel, string falseLabel)
     : this(astQuestion)
 {
     TrueButton.Text = trueLabel;
     FalseButton.Text = falseLabel;
 }
Beispiel #10
0
 public WidgetFactory(Question question)
 {
     _question = question;
 }