[]
Represents the body of a document or other content containers.
public class Body : RangeBase, IContentList<ContentObject>, IReadOnlyList<ContentObject>, IReadOnlyCollection<ContentObject>, IEnumerable<ContentObject>, IEnumerable
Gets the top level children of this body.
public IEnumerable<ContentObject> Children { get; }
Gets the owner of the body.
public object Owner { get; }
Gets the BodyType of this body.
public BodyType Type { get; }
Adds a ContentControl to the end of the current body.
public ContentControl AddContentControl(ContentControlType type, bool fillContent = true)
type ContentControlTypeThe type of the new content control.
fillContent boolIndicates whether to fill the new control's content with default data.
The added ContentControl.
Adds a Paragraph to the end of the current body.
public Paragraph AddParagraph()
Adds a Paragraph to the end of the current body.
public Paragraph AddParagraph(Style style)
style StyleThe paragraph style.
Adds a Paragraph to the end of the current body.
public Paragraph AddParagraph(string text)
text stringThe text of the paragraph.
Adds a Paragraph to the end of the current body.
public Paragraph AddParagraph(string text, Style style)
Adds a Table to the end of the current body.
public Table AddTable()
Adds a Table to the end of the current body.
public Table AddTable(Style style)
style StyleThe table style.
Adds a Table to the end of the current body.
public Table AddTable(int columns, int rows)
Adds a Table to the end of the current body.
public Table AddTable(int columns, int rows, Style style)
columns intThe number of columns in the new table.
rows intThe number of rows in the new table.
style StyleThe table style.
Adds a Table to the end of the current body.
public Table AddTable(string[][] texts)
texts string[][]A two dimensional array of texts to put in the cells. The first dimension determines the number of rows, the second the number of cells.
Adds a Table to the end of the current body.
public Table AddTable(string[][] texts, Style style)
texts string[][]A two dimensional array of texts to put in the cells. The first dimension determines the number of rows, the second dimension determines the number of cells.
style StyleThe table style.
Checks whether a ContentObject of the specified type can be added to the current body.
public bool CanAdd(Type contentObjectType)
contentObjectType TypeThe type of the content object to add.
Checks whether a ContentObject of the specified type can be added to the current body.
public bool CanAdd(Type contentObjectType, out Exception ex)
contentObjectType TypeThe content object type to add.
ex ExceptionOUT: the exception that would be thrown if a content object of the specified type was added.
Checks whether a ContentControl of the specified type can be added to the current body.
public bool CanAddContentControl(ContentControlType type)
type ContentControlTypeThe type of the content control to add.
Checks whether a ContentControl of the specified type can be added to the current body.
public bool CanAddContentControl(ContentControlType type, out Exception ex)
type ContentControlTypeThe type of the content control to add.
ex ExceptionOUT: the exception that would be thrown if a content control of the specified type was added.
Clears all content objects in this body.
public override void Clear()
Gets the collection of this body's children of a specified type.
public IReadOnlyList<T> GetChildren<T>() where T : ContentObject
A readonly list of this object's children with the specified type.
TThe requested type of child objects.