/// <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.PARAGRAPH ||
element.Type == Element.LIST ||
element.Type == Element.CHUNK ||
element.Type == Element.PHRASE ||
element.Type == Element.ANCHOR ||
element.Type == Element.ANNOTATION ||
element.Type == Element.TABLE ||
element.Type == Element.IMGTEMPLATE ||
element.Type == Element.PTABLE ||
element.Type == Element.JPEG ||
element.Type == Element.PHRASE ||
element.Type == Element.GRAPHIC ||
element.Type == Element.ANCHOR ||
element.Type == Element.IMGRAW) {
base.Add(o);
return true;
}
else if (element.Type == Element.SECTION) {
Section section = (Section) o;
section.SetNumbers(++subsections, numbers);
base.Add(section);
return true;
}
else {
throw new Exception(element.Type.ToString());
}
}
catch (Exception cce) {
throw new Exception("Insertion of illegal Element: " + cce.Message);
}
}