コード例 #1
0
 private void RenameSection(SectionContainer snapshotControl)
 {
     if (snapshotControl == null)
     {
         return;
     }
     using (var form = new FormSectionName())
     {
         form.SectionName = snapshotControl.SectionData.Name;
         if (form.ShowDialog(Controller.Instance.FormMain) != DialogResult.OK)
         {
             return;
         }
         snapshotControl.SectionData.Name = form.SectionName;
         snapshotControl.Text             = form.SectionName;
         settingsContainer.UpdateSettingsAccordingDataChanges(SectionEditorType.Schedule);
         SettingsNotSaved = true;
     }
 }
コード例 #2
0
 private void AddSection()
 {
     using (var form = new FormSectionName())
     {
         if (form.ShowDialog(Controller.Instance.FormMain) != DialogResult.OK)
         {
             return;
         }
         var section = EditedContent.CreateSection();
         section.Name = form.SectionName;
         EditedContent.Sections.Add(section);
         EditedContent.RebuildSectionIndexes();
         var sectionControl = AddSectionControl(section);
         xtraTabControlSections.SelectedTabPage = sectionControl;
         settingsContainer.UpdateSettingsAccordingDataChanges(SectionEditorType.Schedule);
         UpdateSectionSplash();
         SettingsNotSaved = true;
     }
 }
コード例 #3
0
 private void CloneSection(SectionContainer sectionControl)
 {
     using (var form = new FormSectionName())
     {
         form.SectionName = String.Format("{0} (Clone)", sectionControl.SectionData.Name);
         if (form.ShowDialog(Controller.Instance.FormMain) != DialogResult.OK)
         {
             return;
         }
         var section = sectionControl.SectionData.Clone <ScheduleSection, ScheduleSection>();
         section.Name   = form.SectionName;
         section.Index += 0.5;
         EditedContent.Sections.Add(section);
         EditedContent.RebuildSectionIndexes();
         var newControl = AddSectionControl(section, (Int32)section.Index);
         xtraTabControlSections.SelectedTabPage = newControl;
         settingsContainer.UpdateSettingsAccordingDataChanges(SectionEditorType.Schedule);
         SettingsNotSaved = true;
     }
 }