public MarkerRenderer(
            ITextView textView,
            ITagAggregator <IVsVisibleTextMarkerTag> markerTagAggregator,
            ITagAggregator <IErrorTag> errorTagAggregator,
            EnvDTE.Debugger debugger,
            SimpleScrollBar scrollBar)
        {
            _textView            = textView;
            _markerTagAggregator = markerTagAggregator;
            _errorTagAggregator  = errorTagAggregator;
            _debugger            = debugger;
            _scrollBar           = scrollBar;

            // ... Pretty convoluted way to get the filename:
            ITextDocument doc;
            bool          success = textView.TextBuffer.Properties.TryGetProperty <ITextDocument>(typeof(ITextDocument), out doc);

            if (success)
            {
                _filename = doc.FilePath;
            }
            else
            {
                _filename = "";
            }
        }
Пример #2
0
		public MarkerRenderer(
			ITextView textView,
			ITagAggregator<IVsVisibleTextMarkerTag> markerTagAggregator,
			ITagAggregator<IErrorTag> errorTagAggregator,
			EnvDTE.Debugger debugger,
			SimpleScrollBar scrollBar)
		{
			_textView = textView;
			_markerTagAggregator = markerTagAggregator;
			_errorTagAggregator = errorTagAggregator;
			_debugger = debugger;
			_scrollBar = scrollBar;

			// ... Pretty convoluted way to get the filename:
			ITextDocument doc;
			bool success = textView.TextBuffer.Properties.TryGetProperty<ITextDocument>(typeof(ITextDocument), out doc);
			if (success)
			{
				_filename = doc.FilePath;
			}
			else
			{
				_filename = "";
			}
		}
Пример #3
0
        public ProgressiveScroll(
            IWpfTextViewMargin containerMargin,
            IWpfTextView textView,
            IOutliningManager outliningManager,
            ITagAggregator <ChangeTag> changeTagAggregator,
            ITagAggregator <IVsVisibleTextMarkerTag> markerTagAggregator,
            ITagAggregator <IErrorTag> errorTagAggregator,
            EnvDTE.Debugger debugger,
            SimpleScrollBar scrollBar,
            ColorSet colors)
        {
            _containerMargin = containerMargin;

            ProgressiveScrollDict.Add(this);

            Colors               = colors;
            _textView            = textView;
            _scrollBar           = scrollBar;
            _markerTagAggregator = markerTagAggregator;
            _errorTagAggregator  = errorTagAggregator;

            RegisterEvents();
            InitSettings();

            _textRenderer = new TextRenderer(this, _textView, outliningManager);
            if (Options.RenderTextEnabled)
            {
                Visuals.Add(_textRenderer.TextVisual);
            }

            MarksVisual = new DrawingVisual();
            Visuals.Add(MarksVisual);

            _changeRenderer    = new ChangeRenderer(_textView, changeTagAggregator, scrollBar);
            _highlightRenderer = new HighlightRenderer(_textView, scrollBar);
            _markerRenderer    = new MarkerRenderer(_textView, markerTagAggregator, errorTagAggregator, debugger, scrollBar);

            foreach (var visual in Visuals)
            {
                AddVisualChild(visual);
            }
        }
		public ProgressiveScroll(
			IWpfTextViewMargin containerMargin,
			IWpfTextView textView,
			IOutliningManager outliningManager,
			ITagAggregator<ChangeTag> changeTagAggregator,
			ITagAggregator<IVsVisibleTextMarkerTag> markerTagAggregator,
			ITagAggregator<IErrorTag> errorTagAggregator,
			EnvDTE.Debugger debugger,
			SimpleScrollBar scrollBar,
			ColorSet colors)
		{
			_containerMargin = containerMargin;

			ProgressiveScrollDict.Add(this);

			Colors = colors;
			_textView = textView;
			_scrollBar = scrollBar;
			_markerTagAggregator = markerTagAggregator;
			_errorTagAggregator = errorTagAggregator;

			RegisterEvents();
			InitSettings();

			_textRenderer = new TextRenderer(this, _textView, outliningManager);
			if (Options.RenderTextEnabled)
			{
				Visuals.Add(_textRenderer.TextVisual);
			}

			MarksVisual = new DrawingVisual();
			Visuals.Add(MarksVisual);

			_changeRenderer = new ChangeRenderer(_textView, changeTagAggregator, scrollBar);
			_highlightRenderer = new HighlightRenderer(_textView, scrollBar);
			_markerRenderer = new MarkerRenderer(_textView, markerTagAggregator, errorTagAggregator, debugger, scrollBar);

			foreach (var visual in Visuals)
			{
				AddVisualChild(visual);
			}
		}
Пример #5
0
        public IWpfTextViewMargin CreateMargin(IWpfTextViewHost textViewHost, IWpfTextViewMargin containerMargin)
        {
            if (textViewHost.TextView.Roles.ContainsAny(RejectedRoles))
            {
                return(null);
            }

            DTE dte = (DTE)ServiceProvider.GetService(typeof(DTE));

            // Hide the real scroll bar
            IWpfTextViewMargin realScrollBar =
                containerMargin.GetTextViewMargin(PredefinedMarginNames.VerticalScrollBar) as IWpfTextViewMargin;

            if (realScrollBar != null)
            {
                realScrollBar.VisualElement.MinWidth = 0.0;
                realScrollBar.VisualElement.Width    = 0.0;
            }

            IWpfTextView textView = textViewHost.TextView;

            SimpleScrollBar scrollBar = new SimpleScrollBar(
                textView,
                containerMargin,
                _scrollMapFactory);

            ProgressiveScroll progressiveScroll = new ProgressiveScroll(
                containerMargin,
                textView,
                _outliningManagerService.GetOutliningManager(textView),
                _tagAggregatorFactoryService.CreateTagAggregator <ChangeTag>(textView),
                _tagAggregatorFactoryService.CreateTagAggregator <IVsVisibleTextMarkerTag>(textView),
                _tagAggregatorFactoryService.CreateTagAggregator <IErrorTag>(textView),
                dte.Debugger,
                scrollBar,
                new ColorSet(FormatMapService.GetEditorFormatMap(textView)));

            return(progressiveScroll);
        }
		public IWpfTextViewMargin CreateMargin(IWpfTextViewHost textViewHost, IWpfTextViewMargin containerMargin)
		{
			if (textViewHost.TextView.Roles.ContainsAny(RejectedRoles))
			{
				return null;
			}

			DTE dte = (DTE) ServiceProvider.GetService(typeof (DTE));

			// Hide the real scroll bar
			IWpfTextViewMargin realScrollBar =
				containerMargin.GetTextViewMargin(PredefinedMarginNames.VerticalScrollBar) as IWpfTextViewMargin;
			if (realScrollBar != null)
			{
				realScrollBar.VisualElement.MinWidth = 0.0;
				realScrollBar.VisualElement.Width = 0.0;
			}

			IWpfTextView textView = textViewHost.TextView;

			SimpleScrollBar scrollBar = new SimpleScrollBar(
				textView,
				containerMargin,
				_scrollMapFactory);

			ProgressiveScroll progressiveScroll = new ProgressiveScroll(
				containerMargin,
				textView,
				_outliningManagerService.GetOutliningManager(textView),
				_tagAggregatorFactoryService.CreateTagAggregator<ChangeTag>(textView),
				_tagAggregatorFactoryService.CreateTagAggregator<IVsVisibleTextMarkerTag>(textView),
				_tagAggregatorFactoryService.CreateTagAggregator<IErrorTag>(textView),
				dte.Debugger,
				scrollBar,
				new ColorSet(FormatMapService.GetEditorFormatMap(textView)));

			return progressiveScroll;
		}
        private static readonly int markerEndOffset   = 0;  // 2


        public HighlightRenderer(ITextView textView, SimpleScrollBar scrollBar)
        {
            _textView  = textView;
            _scrollBar = scrollBar;
        }
Пример #8
0
		public ChangeRenderer(ITextView textView, ITagAggregator<ChangeTag> changeTagAggregator, SimpleScrollBar scrollBar)
		{
			_textView = textView;
			_changeTagAggregator = changeTagAggregator;
			_scrollBar = scrollBar;
		}
Пример #9
0
 public ChangeRenderer(ITextView textView, ITagAggregator <ChangeTag> changeTagAggregator, SimpleScrollBar scrollBar)
 {
     _textView            = textView;
     _changeTagAggregator = changeTagAggregator;
     _scrollBar           = scrollBar;
 }
		public HighlightRenderer(ITextView textView, SimpleScrollBar scrollBar)
		{
			_textView = textView;
			_scrollBar = scrollBar;
		}