public TextSnapshot(TextImage textImage, IContentType contentType, TextBuffer textBuffer, ITextVersion textVersion) { this.textImage = textImage ?? throw new ArgumentNullException(nameof(textImage)); ContentType = contentType ?? throw new ArgumentNullException(nameof(contentType)); TextBuffer = textBuffer ?? throw new ArgumentNullException(nameof(textBuffer)); Version = textVersion ?? throw new ArgumentNullException(nameof(textVersion)); }
void CreateNewCurrentSnapshot(IList <ITextChange> changes, int?reiteratedVersionNumber = null, ITextSource afterTextSource = null) { // It's null the first time it's called from the ctor if (changes != null) { currentTextVersion = currentTextVersion.SetChanges(changes, reiteratedVersionNumber); } var textSource = afterTextSource ?? Document.CreateSnapshot(); var textImage = new TextImage(this, textSource, currentTextVersion.ImageVersion); CurrentSnapshot = new TextSnapshot(textImage, ContentType, this, currentTextVersion); }