public static GenericPage Create(QuestionInfo info, QuestionInfo info2, Action <GenericPage, object[]> onLoadAction) { var page = Create(info, info2); page.OnLoadAction = onLoadAction; return(page); }
private int SetValues2(QuestionInfo info) { var separateText = string.IsNullOrWhiteSpace(DescriptionText.Text) ? string.Empty : Environment.NewLine + Environment.NewLine; Question2Label.Text = info.Question; DescriptionText.Text += separateText + info.Description; return(Rows.Text2); }
public static GenericPage Create(QuestionInfo info, QuestionInfo info2 = null) { var page = new GenericPage(); var rows = new List <int> { Rows.Question, Rows.Description }; rows.Add(page.SetValues((dynamic)info)); if (info2 != null) { rows.Add(Rows.Question2); rows.Add(page.SetValues2((dynamic)info2)); } page.HideAllExceptRows(rows.ToArray()); return(page); }
private void DisplayRowsForYesNoValue(QuestionInfo info, QuestionInfo info2, int defaultTextIndex) { var rows = new List <int> { Rows.YesNoQuestion, Rows.Description }; if (info == null) { DescriptionText.Text = string.Empty; } else { var text = DefaultYesNoText[defaultTextIndex]; rows.Add(Rows.Question); rows.Add(SetValues((dynamic)info)); ResponseText.Text = text; Path.Text = text; if (int.TryParse(text, out var value)) { Combo.SelectedValue = value; } } if (info2 != null) { var text = DefaultYesNoText[defaultTextIndex + 1]; rows.Add(Rows.Question2); rows.Add(SetValues2((dynamic)info2)); Response2Text.Text = text; Path2.Text = text; if (int.TryParse(text, out var value)) { Combo2.SelectedValue = value; } } HideAllExceptRows(rows.ToArray()); }
public static GenericPage Create(QuestionInfo info, Action <GenericPage, object[]> onLoadAction) { return(Create(info, null, onLoadAction)); }
private int SetValues(QuestionInfo info) { QuestionLabel.Text = info.Question; DescriptionText.Text = info.Description; return(Rows.Text); }