Пример #1
0
        public Reference <IQuestionOutputItem> Visit(Reference <IUserInputQuestionNode> node)
        {
            var domainItem = node.ToDomainItem(m_domainItemLocator);

            return(m_outputItemFactory.CreateQuestionOutputItem(
                       domainItem.QuestionText,
                       GetValue(node.Id),
                       GetQuestionType(node.Id),
                       m_questionsCurrentlyVisible,
                       false));
        }
Пример #2
0
        private void Visit(DomainId <IUserInputQuestionNode> questionNode)
        {
            var astNode = questionNode.ToDomainItem(m_domainItemLocator);

            var existingOutput = m_domainItemLocator
                                 .GetAll <IQuestionOutputItem>()
                                 .FirstOrDefault(x => x.Variable.Id == astNode.Id);

            if (existingOutput == null)
            {
                var question = m_outputItemFactory.CreateQuestionOutputItem(
                    new DomainId <IQuestionNode>(questionNode.Id),
                    GetValue(astNode),
                    m_questionsCurrentlyVisible.Peek(),
                    false);

                m_questions.Add(question);
            }
            else
            {
                existingOutput.Visible = m_questionsCurrentlyVisible.Peek();
            }
        }