示例#1
0
        public static GenericPage Create(QuestionInfo info, QuestionInfo info2, Action <GenericPage, object[]> onLoadAction)
        {
            var page = Create(info, info2);

            page.OnLoadAction = onLoadAction;
            return(page);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
        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());
        }
示例#5
0
 public static GenericPage Create(QuestionInfo info, Action <GenericPage, object[]> onLoadAction)
 {
     return(Create(info, null, onLoadAction));
 }
示例#6
0
 private int SetValues(QuestionInfo info)
 {
     QuestionLabel.Text   = info.Question;
     DescriptionText.Text = info.Description;
     return(Rows.Text);
 }