Exemple #1
0
        public VenusMargin(IWpfTextView textView, ITextEditorFactoryService textEditorFactory)
        {
            _projectionBuffer = (IProjectionBuffer)textView.TextBuffer;

            _control = new ProjectionBufferMargin
            {
                DataContext       = _viewModel,
                TextEditorFactory = textEditorFactory,
                TextView          = textView,
            };

            _projectionBuffer.Changed              += OnProjectionBufferChanged;
            _projectionBuffer.SourceSpansChanged   += this.OnProjectionBufferSourceSpansChanged;
            _projectionBuffer.SourceBuffersChanged += OnProjectionBufferSourceBuffersChanged;

            foreach (var b in _projectionBuffer.SourceBuffers)
            {
                _viewModel.SourceBuffers.Add(b);
            }
        }
Exemple #2
0
        public VenusMargin(IWpfTextView textView, ITextEditorFactoryService textEditorFactory)
        {
            _textView = textView;
            _projectionBuffer = (IProjectionBuffer)textView.TextBuffer;

            _control = new ProjectionBufferMargin
            {
                DataContext = _viewModel,
                TextEditorFactory = textEditorFactory,
                TextView = textView,
            };

            _projectionBuffer.Changed += OnProjectionBufferChanged;
            _projectionBuffer.SourceSpansChanged += this.OnProjectionBufferSourceSpansChanged;
            _projectionBuffer.SourceBuffersChanged += OnProjectionBufferSourceBuffersChanged;

            foreach (var b in _projectionBuffer.SourceBuffers)
            {
                _viewModel.SourceBuffers.Add(b);
            }
        }