Search Results for

    Show / Hide Table of Contents

    Class TextContainer

    Represents an object that contains text.

    Inheritance
    System.Object
    ContentElement
    ParentElement
    TextContainer
    Implements
    IronSoftware.Abstractions.IDocumentElement
    IronSoftware.IDocumentObject
    System.ICloneable
    ITextContainer
    Inherited Members
    ParentElement.InsertChildToIndex(Int32, ContentElement[])
    ParentElement.Remove()
    ParentElement.RemoveChildren(ContentElement[])
    ParentElement.RemoveAllChildren()
    ParentElement.ExtractElements<T>()
    ParentElement.GetChildByIndex<T>(Int32)
    ParentElement.Clone()
    ParentElement.CloneObject()
    ParentElement.LogObjectTree()
    ParentElement.DefaultTextStyle
    ParentElement.Texts
    ParentElement.Tables
    ParentElement.Children
    ContentElement.Status
    ContentElement.Replace(ContentElement)
    ContentElement.GetIndex<T>()
    ContentElement.Parent
    ContentElement.ObjNum
    ContentElement.PageIndex
    ContentElement.DocumentId
    Namespace: IronWord.Models.Abstract
    Assembly: IronWord.dll
    Syntax
    public abstract class TextContainer : ParentElement, IDocumentElement, IDocumentObject, ICloneable, ITextContainer

    Constructors

    TextContainer()

    Declaration
    protected TextContainer()

    Methods

    AddChild(ContentElement[])

    Adds one or more child content elements to the current content element.

    Declaration
    public override void AddChild(params ContentElement[] children)
    Parameters
    Type Name Description
    ContentElement[] children

    The content elements to be added as children.

    Overrides
    ParentElement.AddChild(ContentElement[])

    AddText(TextContent)

    Adds a new Run to this paragraph.

    Declaration
    public TextContent AddText(TextContent textContent)
    Parameters
    Type Name Description
    TextContent textContent
    Returns
    Type Description
    TextContent

    AddText(String)

    Adds a new Text to this paragraph.

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

    ExtractText()

    Extract all text from the container

    Declaration
    public string ExtractText()
    Returns
    Type Description
    System.String

    Extracted text

    FindText(String)

    Find the first text element which contains the specified text

    Declaration
    public TextContent FindText(string find)
    Parameters
    Type Name Description
    System.String find

    Text to find

    Returns
    Type Description
    TextContent

    Text element containing the specified text

    Remove(TextContent)

    Remove the specified text element

    Declaration
    public bool Remove(TextContent element)
    Parameters
    Type Name Description
    TextContent element

    Text element to remove

    Returns
    Type Description
    System.Boolean

    True if the element was found and removed, False otherwise

    ReplaceText(String, String)

    Replace all instances of the specified text

    Declaration
    public void ReplaceText(string find, string replace)
    Parameters
    Type Name Description
    System.String find

    Text to replace

    System.String replace

    Replacement text

    Implements

    IronSoftware.Abstractions.IDocumentElement
    IronSoftware.IDocumentObject
    System.ICloneable
    ITextContainer

    Inherited members

    InsertChildToIndex(Int32, ContentElement[])
    Remove()
    RemoveChildren(ContentElement[])
    RemoveAllChildren()
    ExtractElements<T>()
    GetChildByIndex<T>(Int32)
    Clone()
    CloneObject()
    LogObjectTree()
    DefaultTextStyle
    Texts
    Tables
    Children
    Status
    Replace(ContentElement)
    GetIndex<T>()
    Parent
    ObjNum
    PageIndex
    DocumentId
    ☀
    ☾
    Downloads
    • Download with NuGet
    • Start for Free
    In This Article
    Back to top
    Install with NuGet
    Want to deploy IronWord to a live project for FREE?
    What’s included?
    30 days of fully-functional product
    Test and share in a live environment
    No watermarks in production
    Get your free 30-day Trial Key instantly.
    No credit card or account creation required
    Your Trial License Key has been emailed to you.
    Download IronWord free to apply
    your Trial Licenses Key
    Install with NuGet View Licenses
    Licenses from $499. Have a question? Get in touch.