Xamarin.Android

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class GroupShape

    Show / Hide Table of Contents

    Class GroupShape

    Represents the group shape in the Word document.

    Inheritance
    System.Object
    OwnerHolder
    XDLSSerializableBase
    Entity
    WidgetBase
    ParagraphItem
    ShapeCommon
    ShapeBase
    GroupShape
    Implements
    IXDLSSerializable
    IParagraphItem
    IOfficeRun
    IEntity
    Inherited Members
    ShapeBase.HorizontalOrigin
    ShapeBase.HorizontalAlignment
    ShapeBase.HorizontalPosition
    ShapeBase.VerticalOrigin
    ShapeBase.VerticalAlignment
    ShapeBase.VerticalPosition
    ShapeBase.WrapFormat
    ShapeBase.IsBelowText
    ShapeBase.LockAnchor
    ShapeBase.Visible
    ShapeCommon.Height
    ShapeCommon.Width
    ShapeCommon.HeightScale
    ShapeCommon.WidthScale
    ShapeCommon.Item[Int32]
    ShapeCommon.AlternativeText
    ShapeCommon.Name
    ShapeCommon.Title
    ParagraphItem.m_charFormat
    ParagraphItem.ApplyStyle(String)
    ParagraphItem.CloneRun()
    ParagraphItem.Dispose()
    ParagraphItem.OwnerParagraph
    ParagraphItem.IsInsertRevision
    ParagraphItem.IsDeleteRevision
    ParagraphItem.OwnerMathRunElement
    Entity.Clone()
    Entity.Owner
    Entity.NextSibling
    Entity.PreviousSibling
    Entity.IsComposite
    XDLSSerializableBase.IXDLSSerializable.WriteXmlAttributes(IXDLSAttributeWriter)
    XDLSSerializableBase.IXDLSSerializable.WriteXmlContent(IXDLSContentWriter)
    XDLSSerializableBase.IXDLSSerializable.ReadXmlAttributes(IXDLSAttributeReader)
    XDLSSerializableBase.IXDLSSerializable.ReadXmlContent(IXDLSContentReader)
    XDLSSerializableBase.IXDLSSerializable.RestoreReference(String, Int32)
    XDLSSerializableBase.WriteXmlAttributes(IXDLSAttributeWriter)
    XDLSSerializableBase.WriteXmlContent(IXDLSContentWriter)
    XDLSSerializableBase.ReadXmlAttributes(IXDLSAttributeReader)
    XDLSSerializableBase.ReadXmlContent(IXDLSContentReader)
    XDLSSerializableBase.InitXDLSHolder()
    XDLSSerializableBase.RestoreReference(String, Int32)
    XDLSSerializableBase.IXDLSSerializable.XDLSHolder
    XDLSSerializableBase.XDLSHolder
    OwnerHolder.m_doc
    OwnerHolder.Document
    Namespace: Syncfusion.DocIO.DLS
    Assembly: Syncfusion.DocIO.Portable.dll
    Syntax
    public class GroupShape : ShapeBase, IXDLSSerializable, IWidget, IParagraphItem, IOfficeRun, IEntity

    Constructors

    GroupShape(IWordDocument)

    Initializes a new instance of GroupShape class with the specified IWordDocument instance.

    Declaration
    public GroupShape(IWordDocument document)
    Parameters
    Type Name Description
    IWordDocument document

    The IWordDocument instance.

    GroupShape(IWordDocument, ParagraphItem[])

    Initializes a new instance of GroupShape class with the specified IWordDocument instance.

    Declaration
    public GroupShape(IWordDocument document, ParagraphItem[] childShapes)
    Parameters
    Type Name Description
    IWordDocument document

    The IWordDocument instance.

    ParagraphItem[] childShapes

    The ParagraphItem collection within the GroupShape.

    Properties

    EntityType

    Gets the Entity Type

    Declaration
    public override EntityType EntityType { get; }
    Property Value
    Type Description
    EntityType
    Overrides
    Entity.EntityType

    FlipHorizontal

    Gets or sets a Horizontal flipping of GroupShape.

    Declaration
    public bool FlipHorizontal { get; set; }
    Property Value
    Type Description
    System.Boolean

    true indicates that a groupshape has been flipped horizontally; otherwise, false.

    Remarks

    This property returns True if the specified groupshape is flipped around the horizontal axis, and False if not.

    Examples

    The following code example demonstrates how to gets or sets the horizontal flip to group shape.

        //Creates a new Word document 
        WordDocument document = new WordDocument();
        //Adds new section to the document
        IWSection section = document.AddSection();
        //Adds new paragraph to the section
        WParagraph paragraph = section.AddParagraph() as WParagraph;
        //Creates new group shape
        GroupShape groupShape = new GroupShape(document);
        //Adds group shape to the paragraph.
        paragraph.ChildEntities.Add(groupShape);
        //Creates new shape
        Shape shape = new Shape(document, AutoShapeType.RoundedRectangle);
        //Sets height and width for shape
        shape.Height = 100;
        shape.Width = 150;
        //Sets horizontal and vertical position
        shape.HorizontalPosition = 72;
        shape.VerticalPosition = 72;
        //Set wrapping style for shape
        shape.WrapFormat.TextWrappingStyle = TextWrappingStyle.InFrontOfText;
        //Sets horizontal and vertical origin
        shape.HorizontalOrigin = HorizontalOrigin.Page;
        shape.VerticalOrigin = VerticalOrigin.Page;
        //Adds the specified shape to group shape
        groupShape.Add(shape);
        //Creates new picture
        WPicture picture = new WPicture(document);
        picture.LoadImage(Image.FromFile("Image.png"));
        //Sets wrapping style for picture
        picture.TextWrappingStyle = TextWrappingStyle.InFrontOfText;
        //Sets height and width for the image
        picture.Height = 100;
        picture.Width = 100;
        //Sets horizontal and vertical position
        picture.HorizontalPosition = 400;
        picture.VerticalPosition = 150;
        //Sets horizontal and vertical origin
        picture.HorizontalOrigin = HorizontalOrigin.Page;
        picture.VerticalOrigin = VerticalOrigin.Page;
        //Adds the specified picture to group shape
        groupShape.Add(picture);
        //Sets horizontal flip to the group shape
        groupShape.FlipHorizontal = true;
        //Saves the Word document
        document.Save("Sample.docx", FormatType.Docx);
        //Closes the document
        document.Close();
        'Creates a new Word document
        Dim document As WordDocument = New WordDocument
        'Adds new section to the document
        Dim section As IWSection = document.AddSection
        'Adds new paragraph to the section
        Dim paragraph As WParagraph = CType(section.AddParagraph, WParagraph)
        'Creates new group shape
        Dim groupShape As GroupShape = New GroupShape(document)
        'Adds group shape to the paragraph.
        paragraph.ChildEntities.Add(groupShape)
        Dim shape As Shape = New Shape(document, AutoShapeType.RoundedRectangle)
        'Sets height and width for shape
        shape.Height = 100
        shape.Width = 150
        'Sets horizontal and vertical position
        shape.HorizontalPosition = 72
        shape.VerticalPosition = 72
        'Set wrapping style for shape
        shape.WrapFormat.TextWrappingStyle = TextWrappingStyle.InFrontOfText
        'Sets horizontal and vertical origin
        shape.HorizontalOrigin = HorizontalOrigin.Page
        shape.VerticalOrigin = VerticalOrigin.Page
        'Adds the specified shape to group shape
        groupShape.Add(shape)
        Dim picture As WPicture = New WPicture(document)
        picture.LoadImage(Image.FromFile("Image.png"))
        'Sets wrapping style for picture
        picture.TextWrappingStyle = TextWrappingStyle.InFrontOfText
        'Sets height and width for the image
        picture.Height = 100
        picture.Width = 100
        'Sets horizontal and vertical position
        picture.HorizontalPosition = 400
        picture.VerticalPosition = 150
        'Sets horizontal and vertical origin
        picture.HorizontalOrigin = HorizontalOrigin.Page
        picture.VerticalOrigin = VerticalOrigin.Page
        'Adds the specified picture to group shape
        groupShape.Add(picture)
        'Sets horizontal flip to the group shape
        groupShape.FlipHorizontal = True
        'Saves the Word document
        document.Save("Sample.docx", FormatType.Docx)
        'Closes the document
        document.Close()

    FlipVertical

    Gets or sets a Vertical flipping of GroupShape.

    Declaration
    public bool FlipVertical { get; set; }
    Property Value
    Type Description
    System.Boolean

    true indicates that a groupshape has been flipped vertically; otherwise, false.

    Remarks

    This property returns True if the specified groupshape is flipped around the vertical axis, and False if not.

    Examples

    The following code example demonstrates how to gets or sets the vertical flip to group shape.

        //Creates a new Word document 
        WordDocument document = new WordDocument();
        //Adds new section to the document
        IWSection section = document.AddSection();
        //Adds new paragraph to the section
        WParagraph paragraph = section.AddParagraph() as WParagraph;
        //Creates new group shape
        GroupShape groupShape = new GroupShape(document);
        //Adds group shape to the paragraph.
        paragraph.ChildEntities.Add(groupShape);
        //Creates new shape
        Shape shape = new Shape(document, AutoShapeType.RoundedRectangle);
        //Sets height and width for shape
        shape.Height = 100;
        shape.Width = 150;
        //Sets horizontal and vertical position
        shape.HorizontalPosition = 72;
        shape.VerticalPosition = 72;
        //Set wrapping style for shape
        shape.WrapFormat.TextWrappingStyle = TextWrappingStyle.InFrontOfText;
        //Sets horizontal and vertical origin
        shape.HorizontalOrigin = HorizontalOrigin.Page;
        shape.VerticalOrigin = VerticalOrigin.Page;
        //Adds the specified shape to group shape
        groupShape.Add(shape);
        //Creates new picture
        WPicture picture = new WPicture(document);
        picture.LoadImage(Image.FromFile("Image.png"));
        //Sets wrapping style for picture
        picture.TextWrappingStyle = TextWrappingStyle.InFrontOfText;
        //Sets height and width for the image
        picture.Height = 100;
        picture.Width = 100;
        //Sets horizontal and vertical position
        picture.HorizontalPosition = 400;
        picture.VerticalPosition = 150;
        //Sets horizontal and vertical origin
        picture.HorizontalOrigin = HorizontalOrigin.Page;
        picture.VerticalOrigin = VerticalOrigin.Page;
        //Adds the specified picture to group shape
        groupShape.Add(picture);
        //Sets vertical flip to the group shape
        groupShape.FlipVertical = true;
        //Saves the Word document
        document.Save("Sample.docx", FormatType.Docx);
        //Closes the document
        document.Close();
        'Creates a new Word document
        Dim document As WordDocument = New WordDocument
        'Adds new section to the document
        Dim section As IWSection = document.AddSection
        'Adds new paragraph to the section
        Dim paragraph As WParagraph = CType(section.AddParagraph, WParagraph)
        'Creates new group shape
        Dim groupShape As GroupShape = New GroupShape(document)
        'Adds group shape to the paragraph.
        paragraph.ChildEntities.Add(groupShape)
        Dim shape As Shape = New Shape(document, AutoShapeType.RoundedRectangle)
        'Sets height and width for shape
        shape.Height = 100
        shape.Width = 150
        'Sets horizontal and vertical position
        shape.HorizontalPosition = 72
        shape.VerticalPosition = 72
        'Set wrapping style for shape
        shape.WrapFormat.TextWrappingStyle = TextWrappingStyle.InFrontOfText
        'Sets horizontal and vertical origin
        shape.HorizontalOrigin = HorizontalOrigin.Page
        shape.VerticalOrigin = VerticalOrigin.Page
        'Adds the specified shape to group shape
        groupShape.Add(shape)
        Dim picture As WPicture = New WPicture(document)
        picture.LoadImage(Image.FromFile("Image.png"))
        'Sets wrapping style for picture
        picture.TextWrappingStyle = TextWrappingStyle.InFrontOfText
        'Sets height and width for the image
        picture.Height = 100
        picture.Width = 100
        'Sets horizontal and vertical position
        picture.HorizontalPosition = 400
        picture.VerticalPosition = 150
        'Sets horizontal and vertical origin
        picture.HorizontalOrigin = HorizontalOrigin.Page
        picture.VerticalOrigin = VerticalOrigin.Page
        'Adds the specified picture to group shape
        groupShape.Add(picture)
        'Sets vertical flip to the group shape
        groupShape.FlipVertical = True
        'Saves the Word document
        document.Save("Sample.docx", FormatType.Docx)
        'Closes the document
        document.Close()

    Rotation

    Gets or sets the group shape rotation in degree.

    Declaration
    public float Rotation { get; set; }
    Property Value
    Type Description
    System.Single

    The float that specifies the rotation value of the group shape.

    Remarks

    A positive value indicates clockwise rotation; a negative value indicates counterclockwise rotation.

    Examples

    The following code example demonstrates how to gets or sets the rotation value of group shape in degree.

        //Creates a new Word document 
        WordDocument document = new WordDocument();
        //Adds new section to the document
        IWSection section = document.AddSection();
        //Adds new paragraph to the section
        WParagraph paragraph = section.AddParagraph() as WParagraph;
        //Creates new group shape
        GroupShape groupShape = new GroupShape(document);
        //Adds group shape to the paragraph.
        paragraph.ChildEntities.Add(groupShape);
        //Creates new shape
        Shape shape = new Shape(document, AutoShapeType.RoundedRectangle);
        //Sets height and width for shape
        shape.Height = 100;
        shape.Width = 150;
        //Sets horizontal and vertical position
        shape.HorizontalPosition = 72;
        shape.VerticalPosition = 72;
        //Set wrapping style for shape
        shape.WrapFormat.TextWrappingStyle = TextWrappingStyle.InFrontOfText;
        //Sets horizontal and vertical origin
        shape.HorizontalOrigin = HorizontalOrigin.Page;
        shape.VerticalOrigin = VerticalOrigin.Page;
        //Adds the specified shape to group shape
        groupShape.Add(shape);
        //Creates new picture
        WPicture picture = new WPicture(document);
        picture.LoadImage(Image.FromFile("Image.png"));
        //Sets wrapping style for picture
        picture.TextWrappingStyle = TextWrappingStyle.InFrontOfText;
        //Sets height and width for the image
        picture.Height = 100;
        picture.Width = 100;
        //Sets horizontal and vertical position
        picture.HorizontalPosition = 400;
        picture.VerticalPosition = 150;
        //Sets horizontal and vertical origin
        picture.HorizontalOrigin = HorizontalOrigin.Page;
        picture.VerticalOrigin = VerticalOrigin.Page;
        //Adds the specified picture to group shape
        groupShape.Add(picture);
        //Sets group shape rotation in degree  
        groupShape.Rotation = 90;
        //Saves the Word document
        document.Save("Sample.docx", FormatType.Docx);
        //Closes the document
        document.Close();
        'Creates a new Word document
        Dim document As WordDocument = New WordDocument
        'Adds new section to the document
        Dim section As IWSection = document.AddSection
        'Adds new paragraph to the section
        Dim paragraph As WParagraph = CType(section.AddParagraph, WParagraph)
        'Creates new group shape
        Dim groupShape As GroupShape = New GroupShape(document)
        'Adds group shape to the paragraph.
        paragraph.ChildEntities.Add(groupShape)
        Dim shape As Shape = New Shape(document, AutoShapeType.RoundedRectangle)
        'Sets height and width for shape
        shape.Height = 100
        shape.Width = 150
        'Sets horizontal and vertical position
        shape.HorizontalPosition = 72
        shape.VerticalPosition = 72
        'Set wrapping style for shape
        shape.WrapFormat.TextWrappingStyle = TextWrappingStyle.InFrontOfText
        'Sets horizontal and vertical origin
        shape.HorizontalOrigin = HorizontalOrigin.Page
        shape.VerticalOrigin = VerticalOrigin.Page
        'Adds the specified shape to group shape
        groupShape.Add(shape)
        Dim picture As WPicture = New WPicture(document)
        picture.LoadImage(Image.FromFile("Image.png"))
        'Sets wrapping style for picture
        picture.TextWrappingStyle = TextWrappingStyle.InFrontOfText
        'Sets height and width for the image
        picture.Height = 100
        picture.Width = 100
        'Sets horizontal and vertical position
        picture.HorizontalPosition = 400
        picture.VerticalPosition = 150
        'Sets horizontal and vertical origin
        picture.HorizontalOrigin = HorizontalOrigin.Page
        picture.VerticalOrigin = VerticalOrigin.Page
        'Adds the specified picture to group shape
        groupShape.Add(picture)
        'Sets group shape rotation in degree  
        groupShape.Rotation = 90
        'Saves the Word document
        document.Save("Sample.docx", FormatType.Docx)
        'Closes the document
        document.Close()

    Methods

    Add(ParagraphItem)

    Adds the specified shape (picture, shape, group shape) to the group shape.

    Declaration
    public void Add(ParagraphItem childShape)
    Parameters
    Type Name Description
    ParagraphItem childShape

    The ParagraphItem instance

    CloneImpl()

    Creates a duplicate copy of this GroupShape object.

    Declaration
    protected override object CloneImpl()
    Returns
    Type Description
    System.Object

    The reference of the newly created GroupShape.

    Overrides
    ShapeBase.CloneImpl()

    Ungroup()

    Ungroups the child shapes in the group shape

    Declaration
    public ParagraphItem[] Ungroup()
    Returns
    Type Description
    ParagraphItem[]

    Returns the ungrouped items as paragraph item array.

    Implements

    IXDLSSerializable
    IParagraphItem
    IOfficeRun
    IEntity
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved