Table of Contents

Property Edits

Namespace
Alternet.Editor.Wpf
Assembly
Alternet.Editor.Wpf.v9.dll

Edits

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

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

Property Value

IList<TextEditor>

Examples

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

using System.Windows;
using Alternet.Editor.Wpf;

public partial class MainWindow : Window
{
    private TextSource textSource;
    private void Window_Loaded(object sender, RoutedEventArgs e)
    {
        var textEdit1 = new TextEditor();
        var textEdit2 = new TextEditor();
        textSource = new TextSource();
        textSource.LoadFile("myfile.txt");
        textEdit1.Source = this.textSource;
        textEdit2.Source = this.textSource;
    }

    private void Button_Click(object sender, RoutedEventArgs 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
Imports Alternet.Editor.Wpf

Partial Public Class MainWindow
    Inherits Window

    Private textSource As TextSource

    Private Sub Window_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
        Dim textEdit1 = New TextEditor()
        Dim textEdit2 = New TextEditor()
        textSource = New TextSource()
        textSource.LoadFile("myfile.txt")
        textEdit1.Source = Me.textSource
        textEdit2.Source = Me.textSource
    End Sub

    Private Sub Button_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
        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 TextEditor controls can edit the text stored in the TextSource object.

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