Search Results for

    Show / Hide Table of Contents

    Class ParentElement

    Represents the base class for content elements which have children.

    Inheritance
    System.Object
    ContentElement
    ParentElement
    TableElements
    TextContainer
    Container
    DocumentSection
    ListItem
    MultiLevelTextList
    Paragraph
    Run
    Implements
    IronSoftware.Abstractions.IDocumentElement
    IronSoftware.IDocumentObject
    System.ICloneable
    Inherited Members
    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 ParentElement : ContentElement, IDocumentElement, IDocumentObject, ICloneable

    Constructors

    ParentElement()

    Initializes a new instance of the ContentElement class.

    Declaration
    protected ParentElement()

    ParentElement(ContentElement[])

    Initializes a new instance of the ContentElement class with the specified child elements.

    Declaration
    public ParentElement(params ContentElement[] children)
    Parameters
    Type Name Description
    ContentElement[] children

    The child elements to be added.

    Properties

    Children

    Gets the list of child elements contained within this element.

    Declaration
    public ContentElementCollection Children { get; }
    Property Value
    Type Description
    ContentElementCollection

    DefaultTextStyle

    Gets or sets the style of this paragraph. If not specified, it inherits the Document's current/default style.

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

    Tables

    A list of all table elements contained within this element or its children

    See also: ExtractElements<T>()

    Declaration
    public List<Table> Tables { get; }
    Property Value
    Type Description
    System.Collections.Generic.List<Table>

    Texts

    A list of all text elements contained within this element or its children

    See also: ExtractElements<T>()

    Declaration
    public List<TextContent> Texts { get; }
    Property Value
    Type Description
    System.Collections.Generic.List<TextContent>

    Methods

    AddChild(ContentElement[])

    Adds the specified child elements to this element.

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

    The child elements to be added.

    Clone()

    Creates a deep copy of the Element.

    Declaration
    public override object Clone()
    Returns
    Type Description
    System.Object

    A new instance of the Image with all properties copied.

    Overrides
    ContentElement.Clone()

    CloneObject()

    Declaration
    protected override object CloneObject()
    Returns
    Type Description
    System.Object
    Overrides
    ContentElement.CloneObject()

    ExtractElements<T>()

    Extracts all child elements of a specific type from this element.

    Declaration
    public List<T> ExtractElements<T>()
        where T : ContentElement
    Returns
    Type Description
    System.Collections.Generic.List<T>

    A list of child elements of the specified type.

    Type Parameters
    Name Description
    T

    The type of child element to extract.

    GetChildByIndex<T>(Int32)

    Gets the child element at the specified index, cast to the specified type.

    Declaration
    public ContentElement GetChildByIndex<T>(int index)
        where T : ContentElement
    Parameters
    Type Name Description
    System.Int32 index

    The index of the child element.

    Returns
    Type Description
    ContentElement

    The child element at the specified index.

    Type Parameters
    Name Description
    T

    The type of the child element to retrieve.

    InsertChildToIndex(Int32, ContentElement[])

    Inserts the specified child elements at the specified index.

    Declaration
    public void InsertChildToIndex(int index, params ContentElement[] children)
    Parameters
    Type Name Description
    System.Int32 index

    The index at which to insert the children.

    ContentElement[] children

    The child elements to be inserted.

    LogObjectTree()

    Initiates logging of the object tree by traversing from the current object.

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

    Remove()

    Marks this element as deleted.

    Declaration
    public override void Remove()
    Overrides
    ContentElement.Remove()

    RemoveAllChildren()

    Removes all child elements from this element.

    Declaration
    public void RemoveAllChildren()

    RemoveChildren(ContentElement[])

    Removes the specified child elements from this element.

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

    The child elements to be removed.

    Implements

    IronSoftware.Abstractions.IDocumentElement
    IronSoftware.IDocumentObject
    System.ICloneable

    Inherited members

    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.