예제 #1
0
 public EventHookupSessionManager(
     IThreadingContext threadingContext,
     IToolTipService toolTipService
     ) : base(threadingContext)
 {
     _toolTipService = toolTipService;
 }
예제 #2
0
        public AsyncQuickInfoSession(
            IEnumerable <Lazy <IAsyncQuickInfoSourceProvider, IOrderableContentTypeMetadata> > orderedSourceProviders,
            IGuardedOperations guardedOperations,
            JoinableTaskContext joinableTaskContext,
            IToolTipService toolTipService,
            ITextView textView,
            ITrackingPoint triggerPoint,
            QuickInfoSessionOptions options,
            PropertyCollection propertyCollection)
        {
            this.orderedSourceProviders = orderedSourceProviders ?? throw new ArgumentNullException(nameof(orderedSourceProviders));
            this.guardedOperations      = guardedOperations ?? throw new ArgumentNullException(nameof(guardedOperations));
            this.joinableTaskContext    = joinableTaskContext ?? throw new ArgumentNullException(nameof(joinableTaskContext));
            this.toolTipService         = toolTipService ?? throw new ArgumentNullException(nameof(toolTipService));
            this.TextView     = textView ?? throw new ArgumentNullException(nameof(textView));
            this.triggerPoint = triggerPoint ?? throw new ArgumentNullException(nameof(triggerPoint));
            this.Options      = options;

            // Bug #512117: Remove compatibility shims for 2nd gen. Quick Info APIs.
            // We can remove this null check once we remove the legacy APIs.
            this.Properties = propertyCollection ?? new PropertyCollection();

            // Trigger point must be a tracking point on the view's buffer.
            if (triggerPoint.TextBuffer != textView.TextBuffer)
            {
                throw new ArgumentException("The specified ITextSnapshot doesn't belong to the correct TextBuffer");
            }
        }
예제 #3
0
        private InlineHintsTag(
            FrameworkElement adornment,
            ITextView textView,
            SnapshotSpan span,
            InlineHint hint,
            InlineHintsTaggerProvider taggerProvider)
            : base(adornment,
                   removalCallback: null,
                   topSpace: null,
                   baseline: null,
                   // Make the adornment take up the entire line height.  This will cause it to overlap the line
                   // highlighting box on both the top and bottom.  Below, when we create the border object, we will
                   // actually give it a margin so that places itself within the highlight lines properly.
                   textHeight: textView.LineHeight,
                   bottomSpace: null,
                   PositionAffinity.Predecessor)
        {
            _textView           = textView;
            _span               = span;
            _hint               = hint;
            _streamingPresenter = taggerProvider.StreamingFindUsagesPresenter;
            _threadingContext   = taggerProvider.ThreadingContext;
            _toolTipService     = taggerProvider.ToolTipService;

            // Sets the tooltip to a string so that the tool tip opening event can be triggered
            // Tooltip value does not matter at this point because it immediately gets overwritten by the correct
            // information in the Border_ToolTipOpening event handler
            adornment.ToolTip         = "Quick info";
            adornment.ToolTipOpening += Border_ToolTipOpening;
        }
 public EventHookupSessionManager(
     IThreadingContext threadingContext,
     IToolTipService toolTipService,
     IGlobalOptionService globalOptions)
 {
     ThreadingContext = threadingContext;
     _toolTipService  = toolTipService;
     _globalOptions   = globalOptions;
 }
 /// <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, IToolTipService toolTipService)
 {
     _sourceBuffer             = sourceBuffer;
     _view                     = view;
     _view.LayoutChanged      += OnViewLayoutChanged;
     _view.LostAggregateFocus += OnLostAggregateFocus;
     _toolTipProvider          = toolTipService.CreatePresenter(_view);
     if (_view == ActiveTagData.Current?.TextView)
     {
         ShowOrUpdateToolTip();
     }
 }
예제 #6
0
 public InlineParameterNameHintsTaggerProvider(IViewTagAggregatorFactoryService viewTagAggregatorFactoryService,
                                               IClassificationFormatMapService classificationFormatMapService,
                                               IClassificationTypeRegistryService classificationTypeRegistryService,
                                               IThreadingContext threadingContext,
                                               IToolTipService toolTipService,
                                               Lazy <IStreamingFindUsagesPresenter> streamingFindUsagesPresenter)
 {
     _viewTagAggregatorFactoryService       = viewTagAggregatorFactoryService;
     this.ClassificationFormatMapService    = classificationFormatMapService;
     this.ClassificationTypeRegistryService = classificationTypeRegistryService;
     this.ThreadingContext             = threadingContext;
     this.ToolTipService               = toolTipService;
     this.StreamingFindUsagesPresenter = streamingFindUsagesPresenter;
 }
        public AsyncQuickInfoBroker(
            [ImportMany] IEnumerable <Lazy <IAsyncQuickInfoSourceProvider, IOrderableContentTypeMetadata> > unorderedSourceProviders,
            IGuardedOperations guardedOperations,
            IToolTipService toolTipService,
            JoinableTaskContext joinableTaskContext)
        {
            // Bug #512117: Remove compatibility shims for 2nd gen. Quick Info APIs.
            // Combines new + legacy providers into a single series for relative ordering.
            var combinedProviders = unorderedSourceProviders ?? throw new ArgumentNullException(nameof(unorderedSourceProviders));

            this.unorderedSourceProviders = combinedProviders;
#pragma warning restore 618
            this.guardedOperations   = guardedOperations ?? throw new ArgumentNullException(nameof(guardedOperations));
            this.joinableTaskContext = joinableTaskContext ?? throw new ArgumentNullException(nameof(joinableTaskContext));
            this.toolTipService      = toolTipService;
        }
        private InlineParameterNameHintsTag(FrameworkElement adornment, ITextView textView, SnapshotSpan span,
                                            SymbolKey key, InlineParameterNameHintsTaggerProvider taggerProvider)
            : base(adornment, removalCallback: null, PositionAffinity.Predecessor)
        {
            _textView           = textView;
            _span               = span;
            _key                = key;
            _streamingPresenter = taggerProvider.StreamingFindUsagesPresenter;
            _threadingContext   = taggerProvider.ThreadingContext;
            _toolTipService     = taggerProvider.ToolTipService;

            // Sets the tooltip to a string so that the tool tip opening event can be triggered
            // Tooltip value does not matter at this point because it immediately gets overwritten by the correct
            // information in the Border_ToolTipOpening event handler
            adornment.ToolTip         = "Quick info";
            adornment.ToolTipOpening += Border_ToolTipOpening;
        }
예제 #9
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         OnClosing();
         if (_notificationService != null)
         {
             _notificationService.Dispose();
             _notificationService = null;
         }
         if (_toolTipService != null)
         {
             _toolTipService.Dispose();
             _toolTipService = null;
         }
         _viewModel = null;
     }
     base.Dispose(disposing);
 }
예제 #10
0
파일: DialogBase.cs 프로젝트: Kuzq/gitter
        /// <summary>Initializes a new instance of the <see cref="DialogBase"/> class.</summary>
        public DialogBase()
        {
            _notificationService = new BalloonNotificationService();
            _tooltipService = new DefaultToolTipService();
            SuspendLayout();
            if(LicenseManager.UsageMode == LicenseUsageMode.Runtime)
            {
                Font = GitterApplication.FontManager.UIFont;
            }
            else
            {
                Font = SystemFonts.MessageBoxFont;
            }
            AutoScaleMode = AutoScaleMode.Dpi;
            AutoScaleDimensions = new SizeF(96F, 96F);
            ResumeLayout(false);

            Margin = new Padding(10);
        }
예제 #11
0
        /// <summary>Initializes a new instance of the <see cref="DialogBase"/> class.</summary>
        public DialogBase()
        {
            _notificationService = new BalloonNotificationService();
            _tooltipService      = new DefaultToolTipService();
            SuspendLayout();
            if (LicenseManager.UsageMode == LicenseUsageMode.Runtime)
            {
                Font = GitterApplication.FontManager.UIFont;
            }
            else
            {
                Font = SystemFonts.MessageBoxFont;
            }
            AutoScaleMode       = AutoScaleMode.Dpi;
            AutoScaleDimensions = new SizeF(96F, 96F);
            ResumeLayout(false);

            Margin = new Padding(10);
        }
        public InlineHintsTaggerProvider(
            IViewTagAggregatorFactoryService viewTagAggregatorFactoryService,
            IClassificationFormatMapService classificationFormatMapService,
            IClassificationTypeRegistryService classificationTypeRegistryService,
            IThreadingContext threadingContext,
            IUIThreadOperationExecutor operationExecutor,
            IAsynchronousOperationListenerProvider listenerProvider,
            IToolTipService toolTipService,
            ClassificationTypeMap typeMap,
            Lazy <IStreamingFindUsagesPresenter> streamingFindUsagesPresenter)
        {
            _viewTagAggregatorFactoryService       = viewTagAggregatorFactoryService;
            this.ClassificationFormatMapService    = classificationFormatMapService;
            this.ClassificationTypeRegistryService = classificationTypeRegistryService;
            this.ThreadingContext             = threadingContext;
            this.OperationExecutor            = operationExecutor;
            this.ToolTipService               = toolTipService;
            this.StreamingFindUsagesPresenter = streamingFindUsagesPresenter;
            this.TypeMap = typeMap;

            this.AsynchronousOperationListener = listenerProvider.GetListener(FeatureAttribute.InlineHints);
        }
예제 #13
0
 public ToolTipController()
 {
     toolTipService = new ToolTipService();
 }
예제 #14
0
 internal EventHookupSessionManager(IToolTipService toolTipService)
 {
     _toolTipService = toolTipService;
 }
예제 #15
0
파일: ViewBase.cs 프로젝트: Kuzq/gitter
 protected override void Dispose(bool disposing)
 {
     if(disposing)
     {
         OnClosing();
         if(_notificationService != null)
         {
             _notificationService.Dispose();
             _notificationService = null;
         }
         if(_toolTipService != null)
         {
             _toolTipService.Dispose();
             _toolTipService = null;
         }
         _viewModel = null;
     }
     base.Dispose(disposing);
 }
 public EventHookupSessionManager(IThreadingContext threadingContext, IToolTipService toolTipService)
 {
     ThreadingContext = threadingContext;
     _toolTipService  = toolTipService;
 }