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); }
public void Start() { m_QuestionInt = new QuestionInt("Лет", "Введите возраст", 10, 100); }