File Edited

Topics: Developer Forum
Feb 11, 2013 at 11:27 PM
Is there a way to determine if a file has been changed?

I'm writing an IDE and I'm trying to determine if a document has been changed, and how to store that? In the control tag?
Feb 12, 2013 at 4:09 PM
Try the FileSytemWatcher class.

P.S. Try to keep your questions specific to ScintillaNET. :)
Feb 13, 2013 at 3:03 PM
Thanks, I thought ScintillaNET might have had a documentChanged event that maybe was already there, but apparently not, so thanks!
Feb 13, 2013 at 4:33 PM
If you are trying to find out if the text in Scintilla has changed, use the TextChanged event, or the TextInserted and TextDeleted events. This makes no change to any files, however, because files are only updated to reflect the text in the editor if you save them in code. There is a DocumentChanged event, but this also fires during styling, so probably isn't what you want. In some cases, you may also want to examine the CharAdded event.