Beispiel #1
0
        public void Visit(QuestionInt question)
        {
            if (question.Condition?.Evaluate() == false)
            {
                return;
            }
            Panel.Controls.Add(new Label
            {
                Text     = question.Label,
                AutoSize = true
            });
            var numericUpDown = new NumericUpDown
            {
                Minimum       = int.MinValue,
                Maximum       = int.MaxValue,
                DecimalPlaces = 0,
                Value         = question.Value,
                Enabled       = !question.Computed
            };

            if (!question.Computed)
            {
                numericUpDown.ValueChanged += (sender, e) =>
                {
                    question.Value = (int)((NumericUpDown)sender).Value;
                    UpdateControls();
                };
            }
            Panel.Controls.Add(numericUpDown);
        }
Beispiel #2
0
 public void Start()
 {
     m_QuestionInt = new QuestionInt("Лет", "Введите возраст", 10, 100);
 }