Table of Contents

Property LineStyles

Namespace
Alternet.Editor.TextSource
Assembly
Alternet.Editor.v9.dll

LineStyles

Represents an object that implements ILineStyles interface holding collection of line styles for this document.

[Browsable(false)]
public virtual ILineStyles LineStyles { get; set; }

Property Value

ILineStyles

Examples

Here is how to use a LineStyles in the C# code:

using Alternet.Editor;
using Alternet.Editor.TextSource;

public partial class Form1 : Form
{
    private TextSource textSource;
    private void Form1_Load(object sender, EventArgs e)
    {
        var syntaxEdit1 = new SyntaxEdit(this.components);
        var syntaxEdit2 = new SyntaxEdit(this.components);
        syntaxEdit1.LineStyles.AddLineStyle("bookmark", Color.White, Color.Red, Color.Empty, 12, LineStyleOptions.BeyondEol);
        syntaxEdit2.LineStyles.AddLineStyle("bookmark", Color.White, Color.Orange, Color.Empty, 12, LineStyleOptions.BeyondEol);

        textSource = new TextSource(this.components);

        syntaxEdit1.Source = this.textSource;
        syntaxEdit2.Source = this.textSource;
    }

    private void Button_Click(object sender, EventArgs e)
    {
        textSource.LineStyles.SetLineStyle(textSource.Position.Y, 0);
    }
}

Here is how to use a LineStyles in the Visual Basic code:

Imports Alternet.Editor
Imports Alternet.Editor.TextSource

Partial Public Class Form1
    Inherits Form

    Private textSource As TextSource

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
        Dim syntaxEdit1 = New SyntaxEdit(Me.components)
        Dim syntaxEdit2 = New SyntaxEdit(Me.components)
        syntaxEdit1.LineStyles.AddLineStyle("bookmark", Color.White, Color.Red, Color.Empty, 12, LineStyleOptions.BeyondEol)
        syntaxEdit2.LineStyles.AddLineStyle("bookmark", Color.White, Color.Orange, Color.Empty, 12, LineStyleOptions.BeyondEol)
        textSource = New TextSource(Me.components)
        syntaxEdit1.Source = Me.textSource
        syntaxEdit2.Source = Me.textSource
    End Sub

    Private Sub Button_Click(ByVal sender As Object, ByVal e As EventArgs)
        textSource.LineStyles.SetLineStyle(textSource.Position.Y, 0)
    End Sub
End Class

Remarks

Line styles are used to highlight individual text lines in the text displayed by the SyntaxEdit control linked to this TextSource object.

Use <Alternet.Editor.SyntaxEdit.LineStyles> property to configure the appearance of individual line styles, such as background color or image displayed on the gutter area.