Search Results for

    Show / Hide Table of Contents

    Class TextContentElement

    Inheritance
    System.Object
    ContentElement
    TextContentElement
    Text
    Implements
    ICloneableElement
    IContentElement
    ITextContentElement
    IHasTextStyle
    Inherited Members
    ContentElement._Index
    ContentElement.Replace(IContentElement)
    ContentElement.Remove()
    ContentElement.GetIndex()
    ContentElement.Clone()
    ContentElement.CloneObject<T>(T)
    ContentElement.CaptureInitialValues()
    ContentElement.Index
    ContentElement.Parent
    ContentElement.Status
    Namespace: IronPPT.Models.Abstract
    Assembly: IronPPT.dll
    Syntax
    public abstract class TextContentElement : ContentElement, ICloneableElement, IContentElement, ITextContentElement, IHasTextStyle

    Searching and editing the text on a single styled element runs through TextContentElement. It is the abstract base for a stylable piece of text, exposing the string itself plus the find-and-replace operations a developer uses to update wording inside a presentation without rebuilding the element.

    The concrete element that extends it in IronPPT is Text, so most code works with a Text instance and inherits this surface. The Text property is the string the element carries, and TextStyle is the ITextStyle that formats it. Find searches the text for a term and returns the matching index positions as a List<int>, with optional RegexOptions, whole-word, and case-sensitive flags. Replace swaps one term for another using the same options and returns the updated ITextContentElement, so a replace can be chained. ToString returns the element's text for quick inspection. Because the base is abstract, you reach these members through the derived Text element rather than constructing the base directly.

    Text element = new Text();
    element.Text = "Draft report";
    element.Replace("Draft", "Final");

    The add text how-to covers placing text on a slide, and the slide element tutorial puts text elements in the wider slide model.

    Constructors

    TextContentElement()

    Declaration
    protected TextContentElement()

    Properties

    Text

    Declaration
    public string Text { get; set; }
    Property Value
    Type Description
    System.String

    TextStyle

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

    Methods

    Find(String, Nullable<RegexOptions>, Boolean, Boolean)

    Declaration
    public List<int> Find(string searchText, Nullable<RegexOptions> regexOption = null, bool wholeWordOnly = false, bool caseSensitive = false)
    Parameters
    Type Name Description
    System.String searchText
    System.Nullable<System.Text.RegularExpressions.RegexOptions> regexOption
    System.Boolean wholeWordOnly
    System.Boolean caseSensitive
    Returns
    Type Description
    System.Collections.Generic.List<System.Int32>

    Replace(String, String, Nullable<RegexOptions>, Boolean, Boolean)

    Declaration
    public ITextContentElement Replace(string searchText, string replaceText, Nullable<RegexOptions> regexOption = null, bool wholeWordOnly = false, bool caseSensitive = false)
    Parameters
    Type Name Description
    System.String searchText
    System.String replaceText
    System.Nullable<System.Text.RegularExpressions.RegexOptions> regexOption
    System.Boolean wholeWordOnly
    System.Boolean caseSensitive
    Returns
    Type Description
    ITextContentElement

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String

    Implements

    ICloneableElement
    IContentElement
    ITextContentElement
    IHasTextStyle

    Inherited members

    _Index
    Replace(IContentElement)
    Remove()
    GetIndex()
    Clone()
    CloneObject<T>(T)
    CaptureInitialValues()
    Index
    Parent
    Status
    ☀
    ☾
    Downloads
    • Download with NuGet
    • Start for Free
    In This Article
    Back to top
    Install with NuGet