コード例 #1
0
ファイル: PageControl.cs プロジェクト: javachengwc/many-ql
 public void SetResults(ValueTable results)
 {
     foreach (var section in _sections)
     {
         section.SetResults(results);
     }
 }
コード例 #2
0
        public ValueTable Interpretet(QuestionForm form, ValueTable context)
        {
            _context = context;
            _results = new ValueTable();

            Visit(form);

            return(_results);
        }
コード例 #3
0
        public ValueTable Interpretet(QuestionForm form, ValueTable context)
        {
            if (form == null) { throw new ArgumentNullException("form"); }
            if (context == null) { throw new ArgumentNullException("context"); }

            var interpreter = new Interpreter();

            return interpreter.Interpretet(form, context);
        }
コード例 #4
0
        private ValueTable CollectAnswers()
        {
            var answers = new ValueTable();

            foreach (QuestionWidget questionWidget in _questionWidgets)
            {
                answers.Add(questionWidget.QuestionName, questionWidget.GetValue());
            }

            return answers;
        }
コード例 #5
0
        private void SetResults(ValueTable results)
        {
            foreach (QuestionWidget questionWidget in QuestionFlowLayout.Controls)
            {
                questionWidget.Visible = results.HasValue(questionWidget.QuestionName);

                if (results.HasValue(questionWidget.QuestionName))
                {
                    Value result = results.Get(questionWidget.QuestionName);

                    if (!result.IsUndefined)
                    {
                        questionWidget.SetValue(result);
                    }
                }
            }
        }
コード例 #6
0
ファイル: SectionControl.cs プロジェクト: javachengwc/many-ql
        public void SetResults(ValueTable results)
        {
            // We need to set the parent control to 'visible' before we can change the Visible property
            // of any child controls.
            Visible = true;

            foreach (QuestionWidget questionWidget in _questionWidgets)
            {
                questionWidget.Visible = results.HasValue(questionWidget.QuestionName);

                if (results.HasValue(questionWidget.QuestionName))
                {
                    Value result = results.Get(questionWidget.QuestionName);

                    if (!result.IsUndefined)
                    {
                        questionWidget.SetValue(result);
                    }
                }
            }

            Visible = _questionWidgets.Any(widget => widget.Visible);
        }
コード例 #7
0
 private void SetResults(ValueTable results)
 {
     foreach (var page in _pages)
     {
         page.SetResults(results);
     }
 }
コード例 #8
0
 internal ExpressionInterpreter(ValueTable context)
 {
     _context = context;
 }