Class Container
Inheritance
System.Object
Container
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
Container(IContentElement[])
Declaration
public Container(params IContentElement[] children)
Parameters
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
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
Methods
AddChild(IContentElement[])
Declaration
public override void AddChild(params IContentElement[] children)
Parameters
Overrides
Remove()
Declaration
public override void Remove()
Overrides
Implements