Search Results for

    Show / Hide Table of Contents

    Interface ICloneableElement

    Namespace: IronPPT.Interfaces
    Assembly: IronPPT.dll
    Syntax
    public interface ICloneableElement

    Duplicating a slide element without re-building it from scratch runs through ICloneableElement. The contract declares a single Clone() method that returns a new IContentElement carrying the same configuration as the original, so a developer can copy a shape, paragraph, or graphic and then re-parent or tweak the copy. Coding against the contract means a helper that duplicates content does not need to know the element's concrete type.

    In IronPPT the implementors are content classes rather than a single type: the abstract ContentElement base provides the clone behavior, and concrete elements such as Container and the BaseGraphic graphic base inherit it. Because the duplicated element returns as IContentElement, the caller works with it through the same content contract it would use for any element, attaching it where a child is accepted. Use Clone() when you want a faithful copy to position separately rather than sharing a reference to the original.

    IContentElement copy = element.Clone();

    The slide element tutorial covers working with elements on a slide, and the add shape example shows building the kind of element you might clone.

    Methods

    Clone()

    Declaration
    IContentElement Clone()
    Returns
    Type Description
    IContentElement
    ☀
    ☾
    Downloads
    • Download with NuGet
    • Start for Free
    In This Article
    Back to top
    Install with NuGet