Search Results for

    Show / Hide Table of Contents

    Interface IParagraph

    Inherited Members
    IContentElement.Remove()
    IContentElement.Replace(IContentElement)
    IContentElement.Parent
    IContentElement.Status
    IHasParagraphStyle.Style
    Namespace: IronPPT.Interfaces
    Assembly: IronPPT.dll
    Syntax
    public interface IParagraph : IContentElement, IHasParagraphStyle

    IParagraph is the line of text you work through when adding or restyling a block of writing inside a slide. It models a single paragraph: the runs of text it holds, the horizontal alignment of those runs, and the paragraph style that controls spacing, indentation, and bullets. Reach for it whenever a slide needs a new sentence, a re-aligned heading, or a styled list item, and lean on the FAQ below to tell it apart from IRun, which is the smaller text fragment a paragraph contains.

    A developer rarely constructs a paragraph directly. The concrete implementor in IronPPT is Paragraph, which you obtain from a text-bearing element (a text box or shape) and then populate. Because IParagraph extends IContentElement and IHasParagraphStyle, a paragraph also behaves as a positioned element in the slide tree and exposes the paragraph style other shaping calls read from. Coding against the interface keeps editing code decoupled from how the paragraph was created.

    Working with it centers on a few everyday members. AddText appends an IText (or a plain string) and returns the added text so you can style it; Texts lists the IText items already present; Alignment reads and writes the TextAlignment for the line; SetAlignment and SetStyle apply alignment and an IParagraphStyle in a chainable form and return the same IParagraph. Index reports the paragraph's position among its siblings, and Clone copies it.

    IParagraph paragraph = textBox.AddParagraph();
    paragraph.AddText("Quarterly results");
    paragraph.SetAlignment(TextAlignment.Center);

    The add text how-to walks through placing text on a slide, the paragraph style example shows how alignment and spacing come together, and the add paragraph example demonstrates building one from scratch.

    Properties

    Alignment

    Declaration
    TextAlignment Alignment { get; set; }
    Property Value
    Type Description
    TextAlignment

    Index

    Declaration
    int Index { get; set; }
    Property Value
    Type Description
    System.Int32

    Texts

    Declaration
    List<IText> Texts { get; }
    Property Value
    Type Description
    System.Collections.Generic.List<IText>

    Methods

    AddChild(IContentElement[])

    Declaration
    void AddChild(params IContentElement[] children)
    Parameters
    Type Name Description
    IContentElement[] children

    AddText(IText)

    Declaration
    IText AddText(IText text)
    Parameters
    Type Name Description
    IText text
    Returns
    Type Description
    IText

    AddText(String)

    Declaration
    IText AddText(string text)
    Parameters
    Type Name Description
    System.String text
    Returns
    Type Description
    IText

    Clone()

    Declaration
    IContentElement Clone()
    Returns
    Type Description
    IContentElement

    SetAlignment(TextAlignment)

    Declaration
    IParagraph SetAlignment(TextAlignment alignment)
    Parameters
    Type Name Description
    TextAlignment alignment
    Returns
    Type Description
    IParagraph

    SetStyle(IParagraphStyle)

    Declaration
    IParagraph SetStyle(IParagraphStyle style)
    Parameters
    Type Name Description
    IParagraphStyle style
    Returns
    Type Description
    IParagraph

    Inherited members

    Remove()
    Replace(IContentElement)
    Parent
    Status
    Style
    ☀
    ☾
    Downloads
    • Download with NuGet
    • Start for Free
    In This Article
    Back to top
    Install with NuGet