private void TextDocument_TextChanged(object sender, EventArgs e) { UnsavedFile unsavedFile = null; lock (UnsavedFiles) { unsavedFile = UnsavedFiles.BinarySearch(ProjectFile.Location); } if (unsavedFile == null) { lock (UnsavedFiles) { UnsavedFiles.InsertSorted(new UnsavedFile(ProjectFile.Location, TextDocument.Text)); } } else { unsavedFile.Contents = TextDocument.Text; } IsDirty = true; TextChanged?.Invoke(this, new EventArgs()); }
private void TextDocument_TextChanged(object sender, EventArgs e) { UnsavedFile unsavedFile = null; lock (UnsavedFiles) { unsavedFile = UnsavedFiles.BinarySearch(SourceFile.Location); } if (unsavedFile == null) { lock (UnsavedFiles) { UnsavedFiles.InsertSorted(new UnsavedFile(SourceFile.Location, Document.Text)); } } else { unsavedFile.Contents = Document.Text; } }