Exemple #1
0
            private TextBufferContainer(ITextBuffer editorBuffer, Encoding encoding)
            {
                Contract.ThrowIfNull(editorBuffer);
                Contract.ThrowIfNull(encoding);

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

                this.TextImage     = TextBufferMapper.RecordTextSnapshotAndGetImage(editorSnapshot);
                _containerOpt      = TextBufferContainer.From(editorSnapshot.TextBuffer);
                _reiteratedVersion = editorSnapshot.Version.ReiteratedVersionNumber;
                _encodingOpt       = encodingOpt;
            }