Ejemplo n.º 1
0
 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));
 }
Ejemplo n.º 2
0
        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);
        }