Table of Contents

Property Edits

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

Edits

Represents a collection of ISyntaxEdit controls linked to the text source.

[Browsable(false)]
public virtual IList<ISyntaxEdit> Edits { get; }

Property Value

IList<ISyntaxEdit>

Examples

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

using System.Windows.Forms;

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);
        textSource = new TextSource(this.components);
        textSource.LoadFile("myfile.txt");
        syntaxEdit1.Source = this.textSource;
        syntaxEdit2.Source = this.textSource;
    }

    private void Button_Click(object sender, EventArgs e)
    {
        if (textSource.Edits.Count > 0)
            MessageBox.Show(string.Format("Number of edits is:{0}", textSource.Edits.Count.ToString()));
    }
}

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

Imports System.Windows.Forms
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)
        textSource = New TextSource(Me.components)
        textSource.LoadFile("myfile.txt")
        syntaxEdit1.Source = Me.textSource
        syntaxEdit2.Source = Me.textSource
    End Sub

    Private Sub Button_Click(ByVal sender As Object, ByVal e As EventArgs)
        If textSource.Edits.Count > 0 Then MessageBox.Show(String.Format("Number of edits is:{0}", textSource.Edits.Count.ToString()))
    End Sub
End Class

Remarks

One or more SyntaxEdit controls can edit the text stored in the TextSource object.

Use Edits property to get a list of SyntaxEdit controls connected to this TextSource object.