/// <summary> /// Creates a given Section following a set of attributes and adds it to this one. /// </summary> /// <param name="attributes">the attributes</param> /// <returns>the newly added Section</returns> public virtual Section AddSection(Properties attributes) { Section section = new Section(new Paragraph(""), 1); string value; if ((value = attributes.Remove(ElementTags.NUMBER)) != null) { subsections = int.Parse(value) - 1; } if ((value = attributes.Remove(ElementTags.BOOKMARKOPEN)) != null) { this.BookmarkOpen = bool.Parse(value); } section.Set(attributes); Add(section); return section; }