public ITextSnapshot Apply() { if (Canceled || hasApplied) { throw new InvalidOperationException(); } hasApplied = true; textBuffer.ApplyChanges(this, changes, options, reiteratedVersionNumber, editTag); return(textBuffer.CurrentSnapshot); }