private void AddOpenQuestion() { OpenQuestion openQuestion = _subSection.Questions.AddOpenQuestion(); OpenQuestionForm form = new OpenQuestionForm(); form.PickValues(openQuestion); form.ShowDialog(); RefreshQuestions(); }
private void AddOpenQuestion() { OpenQuestion openQuestion = _section.Questions.AddOpenQuestion(); OpenQuestionForm form = new OpenQuestionForm(); form.PickValues(openQuestion); if (form.ShowDialog() == DialogResult.OK) { RefreshQuestions(); } }
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; } }
private void AddOpenQuestion() { if (!(Tree.SelectedNode.Tag is Questions)) { return; } Questions questions = Tree.SelectedNode.Tag as Questions; OpenQuestion openQuestion = (OpenQuestion)questions.Add(QuestionTypes.Open); OpenQuestionForm openQnFrm = new OpenQuestionForm(); openQnFrm.PickValues(openQuestion); if (openQnFrm.ShowDialog() == DialogResult.OK) { TreeNode questionsNode = Tree.SelectedNode; if (questionsNode != null) { var questionNode = AddToParentNode(questionsNode, openQuestion, openQuestion.Name); questionNode.ImageIndex = 3; questionNode.SelectedImageIndex = 3; } } }