public void BeginUpdate()
{
VerifyAccess();
if (inDocumentChanging)
throw new InvalidOperationException("Cannot change document within another document change.");
beginUpdateCount++;
if (beginUpdateCount == 1)
{
undoStack.StartUndoGroup();
if (UpdateStarted != null)
UpdateStarted(this, EventArgs.Empty);
}
}
internal void RegisterAffectedDocument(TextDocument document) { if (affectedDocuments == null) { affectedDocuments = new List <TextDocument>(); } if (!affectedDocuments.Contains(document)) { affectedDocuments.Add(document); document.BeginUpdate(); } }