Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }
Example #4
0
        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);
        }