Xamarin.Android

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

    Show / Hide Table of Contents

    Class LineFormat

    Represents the line format options for the Shape in the Word document.

    Inheritance
    System.Object
    LineFormat
    Namespace: Syncfusion.DocIO.DLS
    Assembly: Syncfusion.DocIO.Portable.dll
    Syntax
    public class LineFormat : Object
    Examples

    The following code example demonstrates how to set the line format to the shape in the document

    private void Button1_Click(System.Object sender, System.EventArgs e)
    {
        //Create a new Word document
        WordDocument document = new WordDocument();
        //Add the section into Word document
        WSection section = document.AddSection() as WSection;
        //Add a paragraph to created section
        WParagraph paragraph = section.AddParagraph() as WParagraph;
        string paraText = "Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula";
        //Append the text to the created paragraph
        paragraph.AppendText(paraText);
        //Add a paragraph to created section
        paragraph = section.AddParagraph() as WParagraph;
        //Add the rectangle shape to the document
        Syncfusion.DocIO.DLS.Shape shape = paragraph.AppendShape(AutoShapeType.Rectangle, 200, 75);
        //Set wrapping type as inline
        shape.WrapFormat.TextWrappingStyle = TextWrappingStyle.Inline;
        //Set the line format for the shape
        shape.LineFormat.Line = true;
        shape.LineFormat.Color = Color.Red;
        shape.LineFormat.DashStyle = LineDashing.DashDot;
        shape.LineFormat.Style = Syncfusion.DocIO.DLS.LineStyle.ThickThin;
        shape.LineFormat.Weight = 3;
        shape.LineFormat.Transparency = 30;
        //Save and close the Word document instance
        document.Save("Sample.docx", FormatType.Docx);
        document.Close();
    }
    Private Sub button_Click(sender As Object, e As EventArgs)
        'Create a new Word document
        Dim document As New WordDocument()
        'Add the section into Word document
        Dim section As WSection = TryCast(document.AddSection(), WSection)
        'Add a paragraph to created section
        Dim paragraph As WParagraph = TryCast(section.AddParagraph(), WParagraph)
        Dim paraText As String = "Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula"
        'Append the text to the created paragraph
        paragraph.AppendText(paraText)
        'Add a paragraph to created section
        paragraph = TryCast(section.AddParagraph(), WParagraph)
        'Add the rectangle shape to the document
        Dim shape As Syncfusion.DocIO.DLS.Shape = paragraph.AppendShape(AutoShapeType.Rectangle, 200, 75)
        'Set wrapping type as inline
        shape.WrapFormat.TextWrappingStyle = TextWrappingStyle.Inline
        'Set the line format for the shape
        shape.LineFormat.Line = True
        shape.LineFormat.Color = Color.Red
        shape.LineFormat.DashStyle = LineDashing.DashDot
        shape.LineFormat.Style = Syncfusion.DocIO.DLS.LineStyle.ThickThin
        shape.LineFormat.Weight = 3
        shape.LineFormat.Transparency = 30
        'Save and close the Word document instance
        document.Save("Sample.docx", FormatType.Docx)
        document.Close()
    End Sub

    Constructors

    LineFormat(Shape)

    Initializes a new instance of LineFormat class for the specified Shape.

    Declaration
    public LineFormat(Shape shape)
    Parameters
    Type Name Description
    Shape shape

    The Shape object.

    Properties

    BeginArrowheadStyle

    Gets or sets the style of the arrowhead at the beginning of the specified line.

    Declaration
    public ArrowheadStyle BeginArrowheadStyle { get; set; }
    Property Value
    Type Description
    ArrowheadStyle

    Color

    Gets or sets a for the outer line of the shape.

    Declaration
    public Color Color { get; set; }
    Property Value
    Type Description
    Color

    The object that specifies line color.

    DashStyle

    Gets or sets the LineDashing for the outline of the shape.

    Declaration
    public LineDashing DashStyle { get; set; }
    Property Value
    Type Description
    LineDashing

    The LineDashing member that specifies the line dashing style.

    EndArrowheadStyle

    Gets or sets the style of the arrowhead at the end of the specified line.

    Declaration
    public ArrowheadStyle EndArrowheadStyle { get; set; }
    Property Value
    Type Description
    ArrowheadStyle

    Item[Int32]

    Gets or sets the value for the property with specified key.

    Declaration
    protected object this[int key] { get; set; }
    Parameters
    Type Name Description
    System.Int32 key

    The key for the property.

    Property Value
    Type Description
    System.Object

    An object with the specific key.

    Line

    Gets or sets the value indicating whether the outline of the shape should be drawn. The default is false.

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

    True if the outline should be drawn; otherwise, false.

    Style

    Gets or sets the outline style for the shapes.

    Declaration
    public LineStyle Style { get; set; }
    Property Value
    Type Description
    LineStyle

    The LineStyle member that specifies the line style.

    Transparency

    Gets or sets the transparency value measured in percentage(%).

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

    The float that specifies the transparency value.

    Weight

    Gets or sets a value for the line weight measured in points.

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

    The float that represents the line weight.

    See Also

    Shape
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved