/// <summary> /// Initializes a new instance of the <see cref="View" /> class. /// </summary> protected View() : base(HtmlTextWriterTag.Div) { Presenter = new Presenter(this); _answerCountLabel = new Label() { Text = ResourceHelper.GetString("AnswerCountDropDownLabel") }; _answerCountDropDown = new DropDownList() { AutoPostBack = true }; QuestionComposerControl = new QuestionComposer() { QuestionLabelText = ResourceHelper.GetString("QuestionLabelText"), AnswerLabelText = ResourceHelper.GetString("AnswerLabelText"), FractionLabelText = ResourceHelper.GetString("FractionLabelText"), ValidatorErrorMessage = ResourceHelper.GetString("FractionValidatorErrorMessage"), IsVisibleLabelText = ResourceHelper.GetString("IsVisibleLabelText") }; _generateXmlButton = new Button() { Text = ResourceHelper.GetString("GenerateXMLButtonText") }; _generateXmlButton.Click += GenerateXmlButton_Click; }
/// <summary> /// Initializes the question composer. /// </summary> protected void InitializeQuestionComposer() { _questionComposer = new QuestionComposer() { QuestionLabelText = ResourceHelper.GetString("QuestionLabelText"), AnswerLabelText = ResourceHelper.GetString("AnswerLabelText"), FractionLabelText = ResourceHelper.GetString("FractionLabelText"), ValidatorErrorMessage = ResourceHelper.GetString("FractionValidatorErrorMessage"), IsVisibleLabelText = ResourceHelper.GetString("IsVisibleLabelText"), Question = QuestionToDisplay, FractionsValidationGroup = "Fractions" }; QuestionEditorPlaceHolder.Controls.Add(_questionComposer); }
private static void Main(string[] args) { var repository = new QuestionRepository(); var questionComposer = new QuestionComposer(repository); PrintAppInformation(); while (true) { Console.Write("INPUT QUESTION TYPE:"); var line = Console.ReadLine(); if (line == "end") { Console.WriteLine("THANKS FOR PLAYING!"); break; } var questionType = (QuestionType)Enum.Parse(typeof(QuestionType), line); var result = questionComposer.ReturnQuestion(questionType); Console.WriteLine(result); } }
public QuestionComposerShould() { _questionRepositoryMock = new Mock <IQuestionRepository>(); _questionComposer = new QuestionComposer(_questionRepositoryMock.Object); }