public Int32 SectionIndexByName(String sectionName) { Int32 sectionIndex = -1; for (Int32 currentSectionIndex = 0; currentSectionIndex < Controls.Count; currentSectionIndex++) { Controls.Section currentSection = (Controls.Section)Controls[currentSectionIndex]; if (currentSection.Name == sectionName) { sectionIndex = currentSectionIndex; break; } } return(sectionIndex); }
public Boolean SectionExists(String sectionName) { Boolean sectionFound = false; for (Int32 currentSectionIndex = 0; currentSectionIndex < Controls.Count; currentSectionIndex++) { Controls.Section currentSection = (Controls.Section)Controls[currentSectionIndex]; if (currentSection.Name == sectionName) { sectionFound = true; break; } } return(sectionFound); }
public Int32 SectionIndex(Guid id) { Int32 sectionIndex = -1; for (Int32 currentSectionIndex = 0; currentSectionIndex < Controls.Count; currentSectionIndex++) { Controls.Section currentSection = (Controls.Section)Controls[currentSectionIndex]; if (currentSection.ControlId == controlId) { sectionIndex = currentSectionIndex; break; } } return(sectionIndex); }
public void InsertSection(Int32 index) { Controls.Section newSection = new Controls.Section(Application, this); Int32 sectionSuffix = 1; if (index == -1) { index = Controls.Count; } while (SectionExists("NewSection" + sectionSuffix.ToString())) { sectionSuffix = sectionSuffix + 1; } newSection.Name = "New Section " + sectionSuffix.ToString(); newSection.Parent = this; Controls.Insert(index, newSection); }