Ejemplo n.º 1
0
        public LoggingTagger(ITextView view, ITextBuffer sourceBuffer, ITextSearchService textSearchService,
                             ITextStructureNavigator textStructureNavigator,
                             IToolTipProviderFactory toolTipProviderFactory)
        {
            _sourceBuffer           = sourceBuffer;
            _view                   = view;
            _textSearchService      = textSearchService;
            _textStructureNavigator = textStructureNavigator;
            // Subscribe to both change events in the view - any time the view is updated
            // or the caret is moved, we refresh our list of highlighted words.
            _view.Caret.PositionChanged += CaretPositionChanged;
            _view.LayoutChanged         += ViewLayoutChanged;
            _toolTipProvider             = toolTipProviderFactory.GetToolTipProvider(_view);
            if (_view == ToolWindow1Control.CurrentTextViewer)
            {
                UpdateAtCaretPosition(_view.Caret.ContainingTextViewLine);
            }

            // TODO: syncronized access.
            if (LoggingTaggerCollection == null)
            {
                LoggingTaggerCollection = new Dictionary <ITextView, LoggingTagger>();
            }
            if (!LoggingTaggerCollection.ContainsKey(view))
            {
                LoggingTaggerCollection.Add(view, this);
            }
            else
            {
                LoggingTaggerCollection[view] = this;
            }
        }
        public ImagePreviewToolTipMouseProcessor(IWpfTextView view, ITextStructureNavigator navigator,
                                                 IToolTipProviderFactory toolTipProviderFactory, ITextDocument textDocument)
        {
            this.spanSearcher    = new StringSpanSearcher(view, navigator);
            this.toolTipProvider = toolTipProviderFactory.GetToolTipProvider(view);
            this.textDocument    = textDocument;

            this.shownSpan = null;
        }
 /// <summary>
 /// Create a new instance of <seealso cref="StackdriverTagger"/> class.
 /// </summary>
 /// <param name="view">The text view on which the tag shows.</param>
 /// <param name="sourceBuffer">The source buffer with the text view.</param>
 /// <param name="toolTipProviderFactory">The tool tip provider. <seealso cref="IToolTipProviderFactory"/>. </param>
 public StackdriverTagger(ITextView view, ITextBuffer sourceBuffer, IToolTipProviderFactory toolTipProviderFactory)
 {
     _sourceBuffer             = sourceBuffer;
     _view                     = view;
     _view.LayoutChanged      += OnViewLayoutChanged;
     _view.LostAggregateFocus += OnLostAggregateFocus;
     _toolTipProvider          = toolTipProviderFactory.GetToolTipProvider(_view);
     if (_view == ActiveTagData.Current?.TextView)
     {
         ShowOrUpdateToolTip();
     }
 }
Ejemplo n.º 4
0
        internal CustomTooltipMouseProcessor(IWpfTextView view, IToolTipProviderFactory
                                             toolTipProviderFactory, ITextStructureNavigator navigatorService, IClassifier classifier)
        {
            this._view             = view;
            this._toolTipProvider  = toolTipProviderFactory.GetToolTipProvider(this._view);
            this._navigatorService = navigatorService;
            this._classifier       = classifier;

            this._systemFonts = Fonts.SystemFontFamilies;

            this.IsToolTipShown = false;
        }