Class Run
Inheritance
System.Object
Run
Assembly: IronPPT.dll
Syntax
public class Run : ParentElement, ICloneableElement, IParentElement, IContentElement, ITextContainer, IHasTextStyle, IRun
Run is the content element you hold when a stretch of text on a slide needs to share one set of formatting. It groups inline text, and the shapes attached to it, under a single text style, so a phrase rendered in one font, weight, and color is built and managed as one unit rather than character by character. It is the inline counterpart to a Paragraph: a paragraph lays out a block of content, while a run carries the styled text inside it.
A Run is created with new Run(), or with the constructor that takes params IText[] to seed it with text right away. Fill it by calling AddText with a string or an IText, and the run becomes a content element that a paragraph or other parent element holds. Because a run keeps its own formatting, splitting a paragraph into several runs is how a single line mixes styles, one run per formatting change.
Formatting for the whole run is set through TextStyle, an ITextStyle that carries font, size, color, and emphasis. Texts exposes the contained IText items for inspection or further editing, and Shapes lists any IShape content the run holds. Clone copies the run when the same styled text is reused, which keeps a repeated label or heading consistent without rebuilding its style.
using IronPPT.Models;
var run = new Run();
run.AddText("Highlighted phrase.");
The add paragraph example builds the paragraphs that hold runs, the add text how-to covers placing text on a slide, and the paragraph style example styles surrounding content.
Constructors
Run()
Declaration
Run(IText[])
Declaration
public Run(params IText[] children)
Parameters
| Type |
Name |
Description |
| IText[] |
children |
|
Properties
Shapes
Declaration
public List<IShape> Shapes { get; }
Property Value
| Type |
Description |
| System.Collections.Generic.List<IShape> |
|
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
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
Clone()
Declaration
public override IContentElement Clone()
Returns
Overrides
Implements