Search Results for

    Show / Hide Table of Contents

    Class Container

    Inheritance
    System.Object
    ContentElement
    ParentElement
    Container
    Implements
    ICloneableElement
    IContainer
    IParentElement
    IContentElement
    Inherited Members
    ParentElement.InsertChildToIndex(Int32, IContentElement[])
    ParentElement.RemoveChildren(IContentElement[])
    ParentElement.RemoveAllChildren()
    ParentElement.ExtractElements<T>()
    ParentElement.GetChildByIndex<T>(Int32)
    ParentElement.Clone()
    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 Container : ParentElement, ICloneableElement, IContainer, IParentElement, IContentElement

    Container is the body of a presentation in IronPPT, the element that holds the slides and the default styles applied across them. It implements the IContainer contract, so when you work with the slide collection and the deck-wide style defaults, this is the concrete type behind that interface.

    A Container sits at the root of the content tree: it is a parent element whose children are the slides and the elements they hold, which is why it carries both a slide collection and the tree-management methods every parent element shares. You reach the slides and styles through its properties and shape the tree through its child methods.

    The everyday members are the collections and defaults. Slides is a read-only List<ISlide> of the deck's slides, BuiltInStyles is a List<IStyle> of the styles the presentation defines, and ParagraphsDefaultStyle (IParagraphStyle) and TextsDefaultStyle (ITextStyle) hold the defaults new text inherits. Because Container extends ParentElement, it also exposes the tree operations: AddChild adds content elements, Remove detaches the container, and the inherited Children, ExtractElements<T>, GetChildByIndex<T>, InsertChildToIndex, and RemoveAllChildren walk and edit the element tree. ExtractElements<T> is especially useful for pulling every element of one kind, such as each shape or text box, out of the whole deck in a single call. Set the default styles once so new paragraphs and runs pick them up automatically rather than restyling each one.

    using IronPPT.Interfaces;
    
    foreach (ISlide slide in container.Slides)
    {
        // work with each slide in the presentation body
    }

    The create empty presentation example starts a deck, the add slide how-to populates it, and the manage slide how-to reorders and removes slides.

    Constructors

    Container()

    Declaration
    public Container()

    Container(IContentElement[])

    Declaration
    public Container(params IContentElement[] children)
    Parameters
    Type Name Description
    IContentElement[] children

    Properties

    BuiltInStyles

    Declaration
    public List<IStyle> BuiltInStyles { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<IStyle>

    ParagraphsDefaultStyle

    Declaration
    public IParagraphStyle ParagraphsDefaultStyle { get; set; }
    Property Value
    Type Description
    IParagraphStyle

    Slides

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

    TextsDefaultStyle

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

    Methods

    AddChild(IContentElement[])

    Declaration
    public override void AddChild(params IContentElement[] children)
    Parameters
    Type Name Description
    IContentElement[] children
    Overrides
    ParentElement.AddChild(IContentElement[])

    Remove()

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

    Implements

    ICloneableElement
    IContainer
    IParentElement
    IContentElement

    Inherited members

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