GemBox.Presentation
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    SlideObjectCollection<TSlide> Class

    Namespace:
    GemBox.Presentation
    Assembly:
    GemBox.Presentation.dll

    Represents a base type for all collections that contain SlideObject derived instances, such as MasterSlideCollection, LayoutSlideCollection and SlideCollection.

    • C#
    • VB.NET
    public abstract class SlideObjectCollection<TSlide> : Collection<TSlide>, IList, ICollection, IList<TSlide>, ICollection<TSlide>, IEnumerable<TSlide>, IEnumerable
    Public MustInherit Class SlideObjectCollection(Of TSlide As SlideObject)
        Inherits Collection(Of TSlide)
        Implements IList, ICollection, IList(Of TSlide), ICollection(Of TSlide), IEnumerable(Of TSlide), IEnumerable
    Type Parameters
    TSlide

    The type of slides derived from the SlideObject that are contained in the collection.

    Inheritance:
    System.Object
    Collection
    Collection<TSlide>
    SlideObjectCollection<TSlide>
    Derived
    LayoutSlideCollection
    MasterSlideCollection
    SlideCollection
    Implements
    System.Collections.IList
    System.Collections.ICollection
    System.Collections.Generic.IList<TSlide>
    System.Collections.Generic.ICollection<TSlide>
    System.Collections.Generic.IEnumerable<TSlide>
    System.Collections.IEnumerable

    Methods

    AddClone(TSlide)

    Adds a clone of the source TSlide to the end of the collection. Clone will be formatted using the destination theme.

    • C#
    • VB.NET
    public TSlide AddClone(TSlide source)
    Public Function AddClone(source As TSlide) As TSlide
    Parameters
    source
    TSlide

    The source TSlide that will be cloned.

    Returns
    TSlide

    A clone of the source TSlide added to the collection.

    Remarks

    Cloning is a process when one or more objects from a presentation are duplicated. Objects can be duplicated to the same or another presentation and to the same or another location (for example, to another slide).

    Cloning methods are available on collection types, such as SlideCollection, DrawingCollection, TextParagraphCollection or TextElementCollection. Exception is the PresentationDocument type that has a Clone() method used to make a deep clone of the entire presentation. Cloning methods available on the collection types have two forms: AddClone(Slide) and InsertClone(Int32, Slide) to append the duplicate to the collection or insert it into a specific location in the collection.

    Objects contained in the presentation can contain references to other objects. For example, Slide contains a reference to its ParentTemplate, Connector can contain a reference to drawings that it connects (BeginConnection and EndConnection), Action can contain a Target to Slide or CustomSlideShow that should be shown when the action is triggered.

    When cloning multiple objects, the desired behavior is to maintain these references in the duplicated objects so that, for example, when Connector is cloned, and later when drawings that it connects are cloned, the duplicated Connector also connects duplicates of the original drawings that are connected.

    This reference mapping between an original object and its duplicate is maintained by the instance of the CloneContext type. CloneContext instance is created with Create(PresentationDocument, PresentationDocument) static method. Each object can be cloned exactly once using the same CloneContext instance. If you want to clone the same object multiple times, each time a new CloneContext instance must be used. CloneContext is the most useful when cloning multiple objects one after another or when you want to change a behavior of the cloning operation.

    Behavior of the cloning operation can be changed by using Set<T>(T, T) method. With this method you can make an explicit mapping between objects and cloning process will respect that mapping. For example, if you are cloning a Slide instance to another PresentationDocument default behavior would be that its parent template LayoutSlide and MasterSlide would also be cloned to another PresentationDocument. This behavior can be changed by making an explicit mapping from the LayoutSlide that is the ParentTemplate of the Slide that will be cloned to some LayoutSlide in the another PresentationDocument that we wish to be a ParentTemplate of the duplicated Slide. Explicit mapping with Set<T>(T, T) method can currently be made between following type (and their derivatives) instances: SlideObject, Drawing, TableStyle and CustomSlideShow.

    Exceptions
    System.ArgumentNullException

    source parameter is null.

    AddClone(TSlide, CloneContext)

    Adds a clone of the source TSlide to the end of the collection.

    • C#
    • VB.NET
    public TSlide AddClone(TSlide source, CloneContext context)
    Public Function AddClone(source As TSlide, context As CloneContext) As TSlide
    Parameters
    source
    TSlide

    The source TSlide that will be cloned.

    context
    CloneContext

    The context used to maintain reference mapping in multiple cloning operations.

    Returns
    TSlide

    A clone of the source TSlide added to the collection.

    Remarks

    Cloning is a process when one or more objects from a presentation are duplicated. Objects can be duplicated to the same or another presentation and to the same or another location (for example, to another slide).

    Cloning methods are available on collection types, such as SlideCollection, DrawingCollection, TextParagraphCollection or TextElementCollection. Exception is the PresentationDocument type that has a Clone() method used to make a deep clone of the entire presentation. Cloning methods available on the collection types have two forms: AddClone(Slide) and InsertClone(Int32, Slide) to append the duplicate to the collection or insert it into a specific location in the collection.

    Objects contained in the presentation can contain references to other objects. For example, Slide contains a reference to its ParentTemplate, Connector can contain a reference to drawings that it connects (BeginConnection and EndConnection), Action can contain a Target to Slide or CustomSlideShow that should be shown when the action is triggered.

    When cloning multiple objects, the desired behavior is to maintain these references in the duplicated objects so that, for example, when Connector is cloned, and later when drawings that it connects are cloned, the duplicated Connector also connects duplicates of the original drawings that are connected.

    This reference mapping between an original object and its duplicate is maintained by the instance of the CloneContext type. CloneContext instance is created with Create(PresentationDocument, PresentationDocument) static method. Each object can be cloned exactly once using the same CloneContext instance. If you want to clone the same object multiple times, each time a new CloneContext instance must be used. CloneContext is the most useful when cloning multiple objects one after another or when you want to change a behavior of the cloning operation.

    Behavior of the cloning operation can be changed by using Set<T>(T, T) method. With this method you can make an explicit mapping between objects and cloning process will respect that mapping. For example, if you are cloning a Slide instance to another PresentationDocument default behavior would be that its parent template LayoutSlide and MasterSlide would also be cloned to another PresentationDocument. This behavior can be changed by making an explicit mapping from the LayoutSlide that is the ParentTemplate of the Slide that will be cloned to some LayoutSlide in the another PresentationDocument that we wish to be a ParentTemplate of the duplicated Slide. Explicit mapping with Set<T>(T, T) method can currently be made between following type (and their derivatives) instances: SlideObject, Drawing, TableStyle and CustomSlideShow.

    Exceptions
    System.ArgumentNullException

    source or context parameter is null.

    System.ArgumentException

    source is not associated with the SourcePresentation or the current collection is not associated with the DestinationPresentation of the context.

    InsertClone(Int32, TSlide)

    Inserts a clone of the source TSlide to the collection at the specified index. Clone will be formatted using the destination theme.

    • C#
    • VB.NET
    public TSlide InsertClone(int index, TSlide source)
    Public Function InsertClone(index As Integer, source As TSlide) As TSlide
    Parameters
    index
    System.Int32

    The zero-based index at which clone of the source TSlide should be inserted.

    source
    TSlide

    The source TSlide that will be cloned.

    Returns
    TSlide

    A clone of the source TSlide inserted to the collection.

    Remarks

    Cloning is a process when one or more objects from a presentation are duplicated. Objects can be duplicated to the same or another presentation and to the same or another location (for example, to another slide).

    Cloning methods are available on collection types, such as SlideCollection, DrawingCollection, TextParagraphCollection or TextElementCollection. Exception is the PresentationDocument type that has a Clone() method used to make a deep clone of the entire presentation. Cloning methods available on the collection types have two forms: AddClone(Slide) and InsertClone(Int32, Slide) to append the duplicate to the collection or insert it into a specific location in the collection.

    Objects contained in the presentation can contain references to other objects. For example, Slide contains a reference to its ParentTemplate, Connector can contain a reference to drawings that it connects (BeginConnection and EndConnection), Action can contain a Target to Slide or CustomSlideShow that should be shown when the action is triggered.

    When cloning multiple objects, the desired behavior is to maintain these references in the duplicated objects so that, for example, when Connector is cloned, and later when drawings that it connects are cloned, the duplicated Connector also connects duplicates of the original drawings that are connected.

    This reference mapping between an original object and its duplicate is maintained by the instance of the CloneContext type. CloneContext instance is created with Create(PresentationDocument, PresentationDocument) static method. Each object can be cloned exactly once using the same CloneContext instance. If you want to clone the same object multiple times, each time a new CloneContext instance must be used. CloneContext is the most useful when cloning multiple objects one after another or when you want to change a behavior of the cloning operation.

    Behavior of the cloning operation can be changed by using Set<T>(T, T) method. With this method you can make an explicit mapping between objects and cloning process will respect that mapping. For example, if you are cloning a Slide instance to another PresentationDocument default behavior would be that its parent template LayoutSlide and MasterSlide would also be cloned to another PresentationDocument. This behavior can be changed by making an explicit mapping from the LayoutSlide that is the ParentTemplate of the Slide that will be cloned to some LayoutSlide in the another PresentationDocument that we wish to be a ParentTemplate of the duplicated Slide. Explicit mapping with Set<T>(T, T) method can currently be made between following type (and their derivatives) instances: SlideObject, Drawing, TableStyle and CustomSlideShow.

    Exceptions
    System.ArgumentNullException

    source parameter is null.

    InsertClone(Int32, TSlide, CloneContext)

    Inserts a clone of the source TSlide to the collection at the specified index.

    • C#
    • VB.NET
    public TSlide InsertClone(int index, TSlide source, CloneContext context)
    Public Function InsertClone(index As Integer, source As TSlide, context As CloneContext) As TSlide
    Parameters
    index
    System.Int32

    The zero-based index at which clone of the source TSlide should be inserted.

    source
    TSlide

    The source TSlide that will be cloned.

    context
    CloneContext

    The context used to maintain reference mapping in multiple cloning operations.

    Returns
    TSlide

    A clone of the source TSlide inserted to the collection.

    Remarks

    Cloning is a process when one or more objects from a presentation are duplicated. Objects can be duplicated to the same or another presentation and to the same or another location (for example, to another slide).

    Cloning methods are available on collection types, such as SlideCollection, DrawingCollection, TextParagraphCollection or TextElementCollection. Exception is the PresentationDocument type that has a Clone() method used to make a deep clone of the entire presentation. Cloning methods available on the collection types have two forms: AddClone(Slide) and InsertClone(Int32, Slide) to append the duplicate to the collection or insert it into a specific location in the collection.

    Objects contained in the presentation can contain references to other objects. For example, Slide contains a reference to its ParentTemplate, Connector can contain a reference to drawings that it connects (BeginConnection and EndConnection), Action can contain a Target to Slide or CustomSlideShow that should be shown when the action is triggered.

    When cloning multiple objects, the desired behavior is to maintain these references in the duplicated objects so that, for example, when Connector is cloned, and later when drawings that it connects are cloned, the duplicated Connector also connects duplicates of the original drawings that are connected.

    This reference mapping between an original object and its duplicate is maintained by the instance of the CloneContext type. CloneContext instance is created with Create(PresentationDocument, PresentationDocument) static method. Each object can be cloned exactly once using the same CloneContext instance. If you want to clone the same object multiple times, each time a new CloneContext instance must be used. CloneContext is the most useful when cloning multiple objects one after another or when you want to change a behavior of the cloning operation.

    Behavior of the cloning operation can be changed by using Set<T>(T, T) method. With this method you can make an explicit mapping between objects and cloning process will respect that mapping. For example, if you are cloning a Slide instance to another PresentationDocument default behavior would be that its parent template LayoutSlide and MasterSlide would also be cloned to another PresentationDocument. This behavior can be changed by making an explicit mapping from the LayoutSlide that is the ParentTemplate of the Slide that will be cloned to some LayoutSlide in the another PresentationDocument that we wish to be a ParentTemplate of the duplicated Slide. Explicit mapping with Set<T>(T, T) method can currently be made between following type (and their derivatives) instances: SlideObject, Drawing, TableStyle and CustomSlideShow.

    Exceptions
    System.ArgumentNullException

    source or context parameter is null.

    System.ArgumentException

    source is not associated with the SourcePresentation or the current collection is not associated with the DestinationPresentation of the context.

    Implements

    System.Collections.IList
    System.Collections.ICollection
    System.Collections.Generic.IList<T>
    System.Collections.Generic.ICollection<T>
    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable

    Examples

    Cloning Example
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.