Class TextContainer
Inheritance
System.Object
TextContainer
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
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
Methods
AddChild(IContentElement[])
Declaration
public override void AddChild(params IContentElement[] children)
Parameters
Overrides
AddText(IText)
Declaration
public IText AddText(IText text)
Parameters
| Type |
Name |
Description |
| IText |
text |
|
Returns
AddText(String)
Declaration
public IText AddText(string text)
Parameters
| Type |
Name |
Description |
| System.String |
text |
|
Returns
Implements