Search Results for

    Show / Hide Table of Contents

    Class TextContainer

    Inheritance
    System.Object
    ContentElement
    ParentElement
    TextContainer
    Implements
    ICloneableElement
    IParentElement
    IContentElement
    ITextContainer
    IHasTextStyle
    Inherited Members
    ParentElement.InsertChildToIndex(Int32, IContentElement[])
    ParentElement.Remove()
    ParentElement.RemoveChildren(IContentElement[])
    ParentElement.RemoveAllChildren()
    ParentElement.ExtractElements<T>()
    ParentElement.GetChildByIndex<T>(Int32)
    ParentElement.Clone()
    ParentElement.CloneElement<T>(T)
    ParentElement.LogObjectTree()
    ParentElement.Children
    ContentElement._Index
    ContentElement.Replace(IContentElement)
    ContentElement.GetIndex()
    ContentElement.CloneObject<T>(T)
    ContentElement.CaptureInitialValues()
    ContentElement.Index
    ContentElement.Parent
    ContentElement.Status
    Namespace: IronPPT.Models.Abstract
    Assembly: IronPPT.dll
    Syntax
    public class TextContainer : ParentElement, ICloneableElement, IParentElement, IContentElement, ITextContainer, IHasTextStyle

    TextContainer is the element you build on when a slide part needs to hold and style runs of text. It collects one or more IText items and applies a single text style across them, so the text inside a shape, cell, or other container behaves as one stylable unit rather than a loose set of strings.

    Read or add text through its members. The Texts property exposes the contained IText items as a List<IText>, and TextStyle is an ITextStyle that governs font, color, and the other run-level formatting applied to the container. AddText has two forms: pass an existing IText to append it, or pass a plain string to add text directly. AddChild accepts IContentElement items, since a TextContainer is also a parent element in the document tree. Each call returns or mutates the same container, so building a block of styled text is a sequence of AddText calls followed by one TextStyle assignment.

    var container = new TextContainer();
    container.AddText("Quarterly summary");
    container.TextStyle.Bold = true;

    The add text how-to walks through placing text on a slide, and the paragraph style example shows text formatting applied in practice.

    Constructors

    TextContainer()

    Declaration
    public TextContainer()

    Properties

    Texts

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

    TextStyle

    Declaration
    public ITextStyle TextStyle { get; set; }
    Property Value
    Type Description
    ITextStyle

    Methods

    AddChild(IContentElement[])

    Declaration
    public override void AddChild(params IContentElement[] children)
    Parameters
    Type Name Description
    IContentElement[] children
    Overrides
    ParentElement.AddChild(IContentElement[])

    AddText(IText)

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

    AddText(String)

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

    Implements

    ICloneableElement
    IParentElement
    IContentElement
    ITextContainer
    IHasTextStyle

    Inherited members

    InsertChildToIndex(Int32, IContentElement[])
    Remove()
    RemoveChildren(IContentElement[])
    RemoveAllChildren()
    ExtractElements<T>()
    GetChildByIndex<T>(Int32)
    Clone()
    CloneElement<T>(T)
    LogObjectTree()
    Children
    _Index
    Replace(IContentElement)
    GetIndex()
    CloneObject<T>(T)
    CaptureInitialValues()
    Index
    Parent
    Status
    ☀
    ☾
    Downloads
    • Download with NuGet
    • Start for Free
    In This Article
    Back to top
    Install with NuGet