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

    Show / Hide Table of Contents

    Group Class

    Namespace:
    GemBox.Document.Drawing
    Assembly:
    GemBox.Document.dll

    Represents a drawing that groups other drawings.

    • C#
    • VB.NET
    public class Group : Element, Inline, DrawingElement, IContentElement
    Public Class Group
        Inherits Element, Inline, DrawingElement
        Implements IContentElement
    Inheritance:
    Object
    Element
    Inline
    DrawingElement
    Group
    Implements
    IContentElement
    Remarks

    Group is currently ignored when exporting a document to PDF, XPS or image file formats on platforms which cannot use WPF assemblies if the following condition is false:

    • Group.Layout is FloatingLayout
    • Group.Layout.HorizontalPosition.PositionType is Absolute and
    • Group.Layout.VerticalPosition.PositionType is Absolute and
    • Group.Layout.Transform.Rotation is 0 and
    • Group.IsCustomSize is false.

    Constructors

    Group(DocumentModel, Layout)

    Initializes a new instance of the Group class.

    • C#
    • VB.NET
    public Group(DocumentModel document, Layout layout)
    Public Sub New(document As DocumentModel, layout As Layout)
    Parameters
    document
    DocumentModel

    The owner document.

    layout
    Layout

    The group shape's layout (position and size).

    Exceptions
    ArgumentNullException

    layout is null.

    Group(DocumentModel, Layout, DrawingElement[])

    Initializes a new instance of the Group class.

    • C#
    • VB.NET
    public Group(DocumentModel document, Layout layout, params DrawingElement[] items)
    Public Sub New(document As DocumentModel, layout As Layout, ParamArray items As DrawingElement())
    Parameters
    document
    DocumentModel

    The owner document.

    layout
    Layout

    The group shape's layout (position and size).

    items
    DrawingElement[]

    The group shape content.

    Exceptions
    ArgumentNullException

    layout is null.

    Group(DocumentModel, Layout, IEnumerable<DrawingElement>)

    Initializes a new instance of the Group class.

    • C#
    • VB.NET
    public Group(DocumentModel document, Layout layout, IEnumerable<DrawingElement> items)
    Public Sub New(document As DocumentModel, layout As Layout, items As IEnumerable(Of DrawingElement))
    Parameters
    document
    DocumentModel

    The owner document.

    layout
    Layout

    The group shape's layout (position and size).

    items
    IEnumerable<DrawingElement>

    The group shape content.

    Exceptions
    ArgumentNullException

    layout is null.

    Properties

    Drawings

    Gets all the drawings contained in this group.

    • C#
    • VB.NET
    public IEnumerable<DrawingElement> Drawings { get; }
    Public ReadOnly Property Drawings As IEnumerable(Of DrawingElement)
    Property Value
    IEnumerable<DrawingElement>

    All the drawings contained in this group.

    ElementType

    Gets the element type for Group which is Group.

    • C#
    • VB.NET
    public override ElementType ElementType { get; }
    Public Overrides ReadOnly Property ElementType As ElementType
    Property Value
    ElementType

    The Group value.

    Overrides
    Element.ElementType

    Fill

    Gets the Brush that specifies how the group's interior drawings are filled.

    • C#
    • VB.NET
    public Brush Fill { get; }
    Public ReadOnly Property Fill As Brush
    Property Value
    Brush

    The Brush that specifies how the group's interior drawings are filled.

    IsCustomSize

    Gets or sets a value indicating whether the size of this group is custom or it should be automatically calculated based on its children.

    • C#
    • VB.NET
    public bool IsCustomSize { get; set; }
    Public Property IsCustomSize As Boolean
    Property Value
    Boolean
    true
    if the size of the group should be as it is, false if the size should be automatically calculated from its children when saving.
    Default value is false.
    

    Methods

    Add(DrawingElement)

    Adds a drawing to this group.

    • C#
    • VB.NET
    public void Add(DrawingElement drawing)
    Public Sub Add(drawing As DrawingElement)
    Parameters
    drawing
    DrawingElement

    The drawing which will be added to this group.

    Clone(Boolean)

    Clones this Group instance.

    • C#
    • VB.NET
    public Group Clone(bool cloneDescendants)
    Public Function Clone(cloneDescendants As Boolean) As Group
    Parameters
    cloneDescendants
    Boolean

    If set to true clone all descendants recursively; otherwise clone only current Group.

    Returns
    Group

    Cloned Group.

    Remarks

    Document content element instance can exist only in a one place in the document.

    If you want to insert document content element into some other part of the same document, then clone the element and insert its clone.

    If you want to insert document content element into another document, then you should first import it into another document with Import<T>(T, Boolean, Boolean) method and then insert the imported element.

    For more information, see cloning example.

    Remove(DrawingElement)

    Removes a drawing from this group.

    • C#
    • VB.NET
    public void Remove(DrawingElement drawing)
    Public Sub Remove(drawing As DrawingElement)
    Parameters
    drawing
    DrawingElement

    The drawing which will be removed from this group.

    Remarks

    Removing drawing will not change the position of the group.

    Explicit Interface Implementations

    IContentElement.get_Content()

    • C#
    • VB.NET
    IEnumerable<ElementCollection> IContentElement.get_Content()
    Function 48bjq8pqwwufccfrkx83wamumvczyy3a   As IEnumerable(Of ElementCollection) Implements IContentElement.get_Content
    Returns
    IEnumerable<ElementCollection>

    Implements

    IContentElement
    Back to top

    Facebook • Twitter

    © GemBox d.o.o. — All rights reserved.