Beispiel #1
0
        private void AddSection()
        {
            Section     section     = _questionaire.Sections.Add();
            SectionForm sectionForm = new SectionForm();

            sectionForm.PickValues(section);
            if (sectionForm.ShowDialog() == DialogResult.OK)
            {
                RefreshSectionsGrid();
            }
        }
Beispiel #2
0
        private void EditSection(MouseEventArgs e)
        {
            TreeNode treeNode = Tree.GetNodeAt(e.X, e.Y);

            if (!(treeNode.Tag is Section))
            {
                return;
            }

            Section     section     = treeNode.Tag as Section;
            SectionForm sectionForm = new SectionForm();

            sectionForm.PickValues(section);
            sectionForm.ShowDialog();
            treeNode.Text = section.Name;
        }
Beispiel #3
0
        private void AddSection()
        {
            if (Tree.SelectedNode == null)
            {
                return;
            }
            if (Tree.SelectedNode.Text != "Sections")
            {
                return;
            }
            Questionaire questionnaire = Tree.SelectedNode.Parent.Tag as Questionaire;
            Section      section       = questionnaire.Sections.Add();
            SectionForm  sectionForm   = new SectionForm();

            sectionForm.PickValues(section);
            sectionForm.ShowDialog();
            var sectionNode = AddToParentNode(Tree.SelectedNode, section, section.Name);

            sectionNode.Tag = section;
            AddSectionSubNodes(sectionNode);
            sectionNode.ImageIndex         = 7;
            sectionNode.SelectedImageIndex = 7;
        }