private static bool AreSameReiteratedVersion(ITextImage oldImage, ITextImage newImage)
            {
                var oldSnapshot = TextBufferMapper.TryFindEditorSnapshot(oldImage);
                var newSnapshot = TextBufferMapper.TryFindEditorSnapshot(newImage);

                return(oldSnapshot != null && newSnapshot != null && oldSnapshot.Version.ReiteratedVersionNumber == newSnapshot.Version.ReiteratedVersionNumber);
            }
            private TextBufferContainer(ITextBuffer editorBuffer, Encoding encoding)
            {
                Contract.ThrowIfNull(editorBuffer);
                Contract.ThrowIfNull(encoding);

                _weakEditorBuffer = new WeakReference <ITextBuffer>(editorBuffer);
                _currentText      = new SnapshotSourceText(TextBufferMapper.ToRoslyn(editorBuffer.CurrentSnapshot), encoding, this);
            }
            private SnapshotSourceText(ITextSnapshot editorSnapshot, Encoding encodingOpt)
            {
                Contract.ThrowIfNull(editorSnapshot);

                this.RoslynSnapshot = TextBufferMapper.ToRoslyn(editorSnapshot);
                _containerOpt       = TextBufferContainer.From(editorSnapshot.TextBuffer);
                _reiteratedVersion  = editorSnapshot.Version.ReiteratedVersionNumber;
                _encodingOpt        = encodingOpt;
            }
 public ITextSnapshot TryFindEditorSnapshot()
 => TextBufferMapper.TryFindEditorSnapshot(this.TextImage);