[]
        
(Showing Draft Content)

GrapeCity.Documents.Word.Body

Class Body

Namespace
GrapeCity.Documents.Word
Assembly
GcDocs.Word.dll

Represents the body of a document or other content containers.

public class Body : RangeBase, IContentList<ContentObject>, IReadOnlyList<ContentObject>, IReadOnlyCollection<ContentObject>, IEnumerable<ContentObject>, IEnumerable
Inheritance
object
Body
Implements
System.Collections.Generic.IReadOnlyList<T><ContentObject>
System.Collections.Generic.IReadOnlyCollection<T><ContentObject>
System.Collections.Generic.IEnumerable<T><ContentObject>
System.Collections.IEnumerable
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Extension Methods

Properties

Children

Gets the top level children of this body.

public IEnumerable<ContentObject> Children { get; }

Property Value

System.Collections.Generic.IEnumerable<T><ContentObject>

Type

Gets the BodyType of this body.

public BodyType Type { get; }

Property Value

BodyType

Methods

AddContentControl(ContentControlType, bool)

Adds a ContentControl to the end of the current body.

public ContentControl AddContentControl(ContentControlType type, bool fillContent = true)

Parameters

type ContentControlType

The type of the new content control.

fillContent bool

Indicates whether to fill the new control's content with default data.

Returns

ContentControl

The added ContentControl.

AddParagraph()

Adds a Paragraph to the end of the current body.

public Paragraph AddParagraph()

Returns

Paragraph

The added Paragraph.

AddParagraph(Style)

Adds a Paragraph to the end of the current body.

public Paragraph AddParagraph(Style style)

Parameters

style Style

The paragraph style.

Returns

Paragraph

The added Paragraph.

AddParagraph(string, Style)

Adds a Paragraph to the end of the current body.

public Paragraph AddParagraph(string text, Style style)

Parameters

text string

The text of the paragraph.

style Style

The paragraph style.

Returns

Paragraph

The added Paragraph.

AddParagraph(string)

Adds a Paragraph to the end of the current body.

public Paragraph AddParagraph(string text)

Parameters

text string

The text of the paragraph.

Returns

Paragraph

The added Paragraph.

AddTable()

Adds a Table to the end of the current body.

public Table AddTable()

Returns

Table

The added Table.

AddTable(Style)

Adds a Table to the end of the current body.

public Table AddTable(Style style)

Parameters

style Style

The table style.

Returns

Table

The added Table.

AddTable(int, int, Style)

Adds a Table to the end of the current body.

public Table AddTable(int columns, int rows, Style style)

Parameters

columns int

The number of columns in the new table.

rows int

The number of rows in the new table.

style Style

The table style.

Returns

Table

The added Table.

AddTable(int, int)

Adds a Table to the end of the current body.

public Table AddTable(int columns, int rows)

Parameters

columns int

The number of columns in the new table.

rows int

The number of rows in the new table.

Returns

Table

The added Table.

AddTable(string[][], Style)

Adds a Table to the end of the current body.

public Table AddTable(string[][] texts, Style style)

Parameters

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 Style

The table style.

Returns

Table

The added Table.

AddTable(string[][])

Adds a Table to the end of the current body.

public Table AddTable(string[][] texts)

Parameters

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.

Returns

Table

The added Table.

CanAdd(Type, out Exception)

Checks whether a ContentObject of the specified type can be added to the current body.

public bool CanAdd(Type contentObjectType, out Exception ex)

Parameters

contentObjectType System.Type

The content object type to add.

ex System.Exception

OUT: the exception that would be thrown if a content object of the specified type was added.

Returns

bool

true if a content object of the specified type can be added, false otherwise.

CanAdd(Type)

Checks whether a ContentObject of the specified type can be added to the current body.

public bool CanAdd(Type contentObjectType)

Parameters

contentObjectType System.Type

The type of the content object to add.

Returns

bool

true if a content object of the specified type can be added, false otherwise.

CanAddContentControl(ContentControlType, out Exception)

Checks whether a ContentControl of the specified type can be added to the current body.

public bool CanAddContentControl(ContentControlType type, out Exception ex)

Parameters

type ContentControlType

The type of the content control to add.

ex System.Exception

OUT: the exception that would be thrown if a content control of the specified type was added.

Returns

bool

true if a content control of the specified type can be added, false otherwise.

CanAddContentControl(ContentControlType)

Checks whether a ContentControl of the specified type can be added to the current body.

public bool CanAddContentControl(ContentControlType type)

Parameters

type ContentControlType

The type of the content control to add.

Returns

bool

true if a content control of the specified type can be added, false otherwise.

Clear()

Clears all content objects in this body.

public override void Clear()

GetChildren<T>()

Gets the collection of this body's children of a specified type.

public IReadOnlyList<T> GetChildren<T>() where T : ContentObject

Returns

System.Collections.Generic.IReadOnlyList<T><T>

A readonly list of this object's children with the specified type.

Type Parameters

T

The requested type of child objects.