Example #1
0
 private void CreateSection()
 {
     using (var sectionName = new SectionNameDialog(this))
     {
         sectionName.ShowDialog();
         if (sectionName.SectionName != null)
         {
             testForEdit.Sections.Add(sectionName.SectionName);
             tvQuestions.Nodes.Add(sectionName.SectionName, sectionName.SectionName);
             buttonDeleteVopr.Enabled    = false;
             buttonDeleteSection.Enabled = false;
             ResetQuestionPreview();
         }
     }
 }
Example #2
0
        private void ChangeSection()
        {
            using (var sectionName = new SectionNameDialog(this, currentSection))
            {
                sectionName.ShowDialog();
                if (sectionName.SectionName != null)
                {
                    testForEdit.Sections.Remove(currentSection);
                    testForEdit.Sections.Add(sectionName.SectionName);

                    foreach (var question in testForEdit.Questions)
                    {
                        if (question.Section == currentSection)
                        {
                            question.Section = sectionName.SectionName;
                        }
                    }
                    InitTestControls();
                    //buttonDeleteVopr.Enabled = false;
                    //buttonDeleteSection.Enabled = false;
                    //ResetQuestionPreview();
                }
            }
        }