public CalendarWidget(Question astQuestion) : base(astQuestion) { InitializeComponent(); QuestionLabel.Text = Question.Label; AnswerDatePicker.Enabled = !astQuestion.IsComputed; }
public CheckBoxWidget(Question astQuestion) : base(astQuestion) { InitializeComponent(); QuestionLabel.Text = Question.Label; YesCheckBox.Enabled = !astQuestion.IsComputed; }
public RadioWidget(Question astQuestion) : base(astQuestion) { InitializeComponent(); QuestionLabel.Text = Question.Label; TrueButton.Enabled = !astQuestion.IsComputed; FalseButton.Enabled = !astQuestion.IsComputed; }
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; }
protected QuestionWidget(Question astQuestion) : this() { Question = astQuestion; }
public RadioWidget(Question astQuestion, string trueLabel, string falseLabel) : this(astQuestion) { TrueButton.Text = trueLabel; FalseButton.Text = falseLabel; }
public WidgetFactory(Question question) { _question = question; }