[]
        
(Showing Draft Content)

GrapeCity.Documents.Word.Section

Class Section

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

Represents a section element in a body content.

public class Section : IBrowsable<Section>
Inheritance
object
Section
Implements
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

Properties

Children

Gets the collection of the children of this content object.

public IEnumerable<ContentObject> Children { get; }

Property Value

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

Document

Gets the DocumentBase that contains this content object.

public DocumentBase Document { get; }

Property Value

DocumentBase

End

Gets the Marker representing the end of this content object in the parent body.

public Marker End { get; }

Property Value

Marker

Footers

Gets the collection of footers for this section.

public HeaderFooterCollection Footers { get; }

Property Value

HeaderFooterCollection

Guid

Gets the section unique identifier.

public string Guid { get; }

Property Value

string

Headers

Gets the collection of headers for this section.

public HeaderFooterCollection Headers { get; }

Property Value

HeaderFooterCollection

Next

Gets the next section.

public Section Next { get; }

Property Value

Section

PageSetup

Gets the PageSetup object associated with this section.

public PageSetup PageSetup { get; }

Property Value

PageSetup

ParentBody

Gets the parent Body of this content object.

public Body ParentBody { get; }

Property Value

Body

Previous

Gets the previous section.

public Section Previous { get; }

Property Value

Section

ProtectedForForms

Gets or sets a value indicating whether this section is protected for forms.

When a section is protected for forms, users can select and modify text only in form fields in Microsoft Word.

public bool ProtectedForForms { get; set; }

Property Value

bool

RevisionId

Gets unique identifiers used to track the section editing session.

public SectionRevisionId RevisionId { get; }

Property Value

SectionRevisionId

Start

Gets the Marker representing the start of this content object in the parent body.

public Marker Start { get; }

Property Value

Marker

Methods

AddContentControl(ContentControlType, bool)

Adds a ContentControl to the end of the section.

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

Parameters

type ContentControlType

The new content control type.

fillContent bool

Whether to fill the new control content with default data.

Returns

ContentControl

The added ContentControl.

AddParagraph()

Adds a Paragraph to the end of the section.

public Paragraph AddParagraph()

Returns

Paragraph

The added Paragraph.

AddParagraph(Style)

Adds a Paragraph to the end of the section.

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 section.

public Paragraph AddParagraph(string text, Style style)

Parameters

text string

The text of the added Paragraph

style Style

The paragraph style.

Returns

Paragraph

The added Paragraph.

AddParagraph(string)

Adds a Paragraph to the end of the section.

public Paragraph AddParagraph(string text)

Parameters

text string

The text of the added Paragraph

Returns

Paragraph

The added Paragraph.

AddTable()

Adds a Table to the end of the section.

public Table AddTable()

Returns

Table

The added Table.

AddTable(Style)

Adds a Table to the end of the section.

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 section.

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 section.

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 section.

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 the number of cells.

style Style

The table style.

Returns

Table

The added Table.

AddTable(string[][])

Adds a Table to the end of the section.

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 section.

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 section.

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 section.

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 section.

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.

Delete()

Deletes the section from the parent Body.

public void Delete()

GetChildren<T>()

Gets the collection of this section'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.

GetRange()

Creates and returns a Range associated with this content object.

public Range GetRange()

Returns

Range

A new Range instance associated with this content object.

MergeWithNext()

Merges this section with the next one.

public Section MergeWithNext()

Returns

Section

The merged section.

MergeWithPrevious()

Merges this section with the previous one.

public Section MergeWithPrevious()

Returns

Section

The merged section.

ToString()

Gets string representation of the section.

public override string ToString()

Returns

string

String representation of the section.