Search Results for

    Show / Hide Table of Contents

    Class Run

    Inheritance
    System.Object
    ContentElement
    ParentElement
    Run
    Implements
    ICloneableElement
    IParentElement
    IContentElement
    ITextContainer
    IHasTextStyle
    IRun
    Inherited Members
    ParentElement.AddChild(IContentElement[])
    ParentElement.InsertChildToIndex(Int32, IContentElement[])
    ParentElement.Remove()
    ParentElement.RemoveChildren(IContentElement[])
    ParentElement.RemoveAllChildren()
    ParentElement.ExtractElements<T>()
    ParentElement.GetChildByIndex<T>(Int32)
    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
    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
    public Run()

    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
    Type Description
    ITextStyle

    Methods

    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

    Clone()

    Declaration
    public override IContentElement Clone()
    Returns
    Type Description
    IContentElement
    Overrides
    ParentElement.Clone()

    Implements

    ICloneableElement
    IParentElement
    IContentElement
    ITextContainer
    IHasTextStyle
    IRun

    Inherited members

    AddChild(IContentElement[])
    InsertChildToIndex(Int32, IContentElement[])
    Remove()
    RemoveChildren(IContentElement[])
    RemoveAllChildren()
    ExtractElements<T>()
    GetChildByIndex<T>(Int32)
    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