Example #1
0
        /**
         * Creates a <CODE>Section</CODE>, add it to this <CODE>Section</CODE> and returns it.
         *
         * @param   numberDepth the numberDepth of the section
         * @return  a new Section object
         */
        public MarkedSection AddSection(int numberDepth)
        {
            MarkedSection section = ((Section)element).AddMarkedSection();

            section.NumberDepth = numberDepth;
            return(section);
        }
Example #2
0
        /**
         * Creates a <CODE>Section</CODE>, adds it to this <CODE>Section</CODE> and returns it.
         *
         * @param   indentation the indentation of the new section
         * @return  a new Section object
         */

        public MarkedSection AddSection(float indentation)
        {
            MarkedSection section = ((Section)element).AddMarkedSection();

            section.Indentation = indentation;
            return(section);
        }
Example #3
0
        /**
         * Adds a marked section. For use in class MarkedSection only!
         */
        public MarkedSection AddMarkedSection()
        {
            MarkedSection section = new MarkedSection(new Section(null, numberDepth + 1));

            Add(section);
            return(section);
        }
Example #4
0
 /// <summary>
 /// Adds a Paragraph, List, Table or another Section
 /// to this Section.
 /// </summary>
 /// <param name="o">an object of type Paragraph, List, Table or another Section</param>
 /// <returns>a bool</returns>
 public new bool Add(Object o)
 {
     try
     {
         IElement element = (IElement)o;
         if (element.Type == Element.SECTION)
         {
             Section section = (Section)o;
             section.SetNumbers(++subsections, numbers);
             base.Add(section);
             return(true);
         }
         else if (o is MarkedSection && ((MarkedObject)o).element.Type == Element.SECTION)
         {
             MarkedSection mo      = (MarkedSection)o;
             Section       section = (Section)(mo.element);
             section.SetNumbers(++subsections, numbers);
             base.Add(mo);
             return(true);
         }
         else if (element.IsNestable())
         {
             base.Add(o);
             return(true);
         }
         else
         {
             throw new Exception(element.Type.ToString());
         }
     }
     catch (Exception cce)
     {
         throw new Exception("Insertion of illegal Element: " + cce.Message);
     }
 }
Example #5
0
        /**
         * Creates a <CODE>Section</CODE>, adds it to this <CODE>Section</CODE> and returns it.
         *
         * @param   indentation the indentation of the new section
         * @param   numberDepth the numberDepth of the section
         * @return  a new Section object
         */

        public MarkedSection AddSection(float indentation, int numberDepth)
        {
            MarkedSection section = ((Section)element).AddMarkedSection();

            section.Indentation = indentation;
            section.NumberDepth = numberDepth;
            return(section);
        }
Example #6
0
 /**
 * Adds a marked section. For use in class MarkedSection only!
 */
 public MarkedSection AddMarkedSection()
 {
     MarkedSection section = new MarkedSection(new Section(null, numberDepth + 1));
     Add(section);
     return section;
 }