Property Modified
- Namespace
- Alternet.Editor.TextSource
- Assembly
- Alternet.Editor.v9.dll
Modified
Gets or sets a value indicating whether the control's text content is modified.
[Browsable(false)]
public virtual bool Modified { get; set; }
Property Value
Examples
Here is how to use a Modified 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 syntaxEdit = new SyntaxEdit(this.components);
textSource = new TextSource(this.components);
textSource.LoadFile("myfile.txt");
syntaxEdit.Source = this.textSource;
}
private void SaveButton_Click(object sender, EventArgs e)
{
if (textSource.Modified)
textSource.SaveFile(textSource.FileName);
}
}
Here is how to use a Modified 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 syntaxEdit = New SyntaxEdit(Me.components)
textSource = New TextSource(Me.components)
textSource.LoadFile("myfile.txt")
syntaxEdit.Source = Me.textSource
End Sub
Private Sub SaveButton_Click(ByVal sender As Object, ByVal e As EventArgs)
If textSource.Modified Then textSource.SaveFile(textSource.FileName)
End Sub
End Class
Remarks
Use the Modified property to determine if the user has changed the text contents displayed by the linked SyntaxEdit control since it was the last set or loaded from the file.