コード例 #1
0
        public FileChange(TextDocument left,
                          TextDocument right,
                          IComponentModel componentModel,
                          AbstractChange parent,
                          PreviewEngine engine,
                          IVsImageService2 imageService) : base(engine)
        {
            Contract.ThrowIfFalse(left != null || right != null);

            this.Id       = left != null ? left.Id : right.Id;
            _left         = left;
            _right        = right;
            _imageService = imageService;

            _componentModel = componentModel;
            var bufferFactory = componentModel.GetService <ITextBufferFactoryService>();
            var bufferText    = left != null
                ? left.GetTextSynchronously(CancellationToken.None)
                : right.GetTextSynchronously(CancellationToken.None);

            _buffer   = bufferFactory.CreateTextBuffer(bufferText.ToString(), bufferFactory.InertContentType);
            _encoding = bufferText.Encoding;

            this.Children = ComputeChildren(left, right, CancellationToken.None);
            this.parent   = parent;
        }
コード例 #2
0
ファイル: FileChange.cs プロジェクト: RoryVL/roslyn
        public FileChange(TextDocument left,
            TextDocument right,
            IComponentModel componentModel,
            AbstractChange parent,
            PreviewEngine engine,
            IVsImageService2 imageService) : base(engine)
        {
            Contract.ThrowIfFalse(left != null || right != null);

            this.Id = left != null ? left.Id : right.Id;
            _left = left;
            _right = right;
            _imageService = imageService;

            _componentModel = componentModel;
            var bufferFactory = componentModel.GetService<ITextBufferFactoryService>();
            var bufferText = left != null ?
                left.GetTextAsync(CancellationToken.None).WaitAndGetResult(CancellationToken.None) :
                right.GetTextAsync(CancellationToken.None).WaitAndGetResult(CancellationToken.None);
            _buffer = bufferFactory.CreateTextBuffer(bufferText.ToString(), bufferFactory.InertContentType);
            _encoding = bufferText.Encoding;

            this.Children = ComputeChildren(left, right, CancellationToken.None);
            this.parent = parent;
        }
コード例 #3
0
ファイル: SpanChange.cs プロジェクト: elemk0vv/roslyn-1
 public SpanChange(ITrackingSpan span, ITextBuffer buffer, DocumentId id, string text, string leftText, string rightText, bool isDeletion, AbstractChange parent, PreviewEngine engine)
     : base(engine)
 {
     _span = span;
     _id = id;
     _buffer = buffer;
     _text = text;
     this.parent = parent;
     _rightText = rightText;
     _leftText = leftText;
     _isDeletion = isDeletion;
     this.Children = new ChangeList(new AbstractChange[0]);
 }
コード例 #4
0
 public SpanChange(
     ITrackingSpan span,
     ITextBuffer buffer,
     DocumentId id,
     string text,
     string leftText,
     string rightText,
     bool isDeletion,
     AbstractChange parent,
     PreviewEngine engine
     ) : base(engine)
 {
     _span         = span;
     _id           = id;
     _buffer       = buffer;
     _text         = text;
     this.parent   = parent;
     _rightText    = rightText;
     _leftText     = leftText;
     _isDeletion   = isDeletion;
     this.Children = new ChangeList(Array.Empty <AbstractChange>());
 }
コード例 #5
0
ファイル: ChangeList.cs プロジェクト: elemk0vv/roslyn-1
 public ChangeList(AbstractChange[] changes)
 {
     this.Changes = changes;
 }