예제 #1
0
        private void AddClosedQuestion()
        {
            ClosedQuestion     closedQuestion = (ClosedQuestion)_section.Questions.Add(QuestionTypes.Closed);
            ChoiceQuestionForm closedQnFrm    = new ChoiceQuestionForm();

            closedQnFrm.PickValues(closedQuestion);
            closedQnFrm.ShowDialog();
            RefreshQuestions();
        }
예제 #2
0
파일: Main.cs 프로젝트: lulzzz/DCAnalytics
        private void EditQuestion(MouseEventArgs e)
        {
            TreeNode treeNode = Tree.GetNodeAt(e.X, e.Y);

            if (!(treeNode.Tag is Question))
            {
                return;
            }
            Question question = treeNode.Tag as Question;

            switch (question.QuestionType)
            {
            case QuestionTypes.Closed:
                ChoiceQuestionForm form = new ChoiceQuestionForm();
                form.PickValues(question as ClosedQuestion);
                if (form.ShowDialog() == DialogResult.OK)
                {
                    treeNode.Text = question.Name;
                }
                break;

            case QuestionTypes.MultipleChoice:
                ChoiceQuestionForm formM = new ChoiceQuestionForm();
                formM.PickValues(question as MultipleChoiceQuestion);
                if (formM.ShowDialog() == DialogResult.OK)
                {
                    treeNode.Text = question.Name;
                }
                break;

            case QuestionTypes.Open:
                OpenQuestionForm formOpen = new OpenQuestionForm();
                formOpen.PickValues(question as OpenQuestion);
                if (formOpen.ShowDialog() == DialogResult.OK)
                {
                    treeNode.Text = question.Name;
                }
                break;
            }
        }
예제 #3
0
파일: Main.cs 프로젝트: lulzzz/DCAnalytics
        private void AddMultipleChoiceQuestion()
        {
            if (!(Tree.SelectedNode.Tag is Questions))
            {
                return;
            }
            Questions questions = Tree.SelectedNode.Tag as Questions;
            MultipleChoiceQuestion closedQuestion = (MultipleChoiceQuestion)questions.Add(QuestionTypes.MultipleChoice);
            ChoiceQuestionForm     closedQnFrm    = new ChoiceQuestionForm();

            closedQnFrm.PickValues(closedQuestion);
            if (closedQnFrm.ShowDialog() == DialogResult.OK)
            {
                TreeNode questionsNode = Tree.SelectedNode;
                if (questionsNode != null)
                {
                    var questionNode = AddToParentNode(questionsNode, closedQuestion, closedQuestion.Name);
                    questionNode.ImageIndex         = 10;
                    questionNode.SelectedImageIndex = 10;
                }
            }
        }