Ejemplo n.º 1
0
        public void HandleToolTipRequest(ToolTipRequestEventArgs args)
        {
            if (!args.InDocument)
            {
                return;
            }
            var offset = _editor.Document.GetOffset(args.LogicalPosition);

            //FoldingManager foldings = _editor.GetService(typeof(FoldingManager)) as FoldingManager;
            //if (foldings != null)
            //{
            //    var foldingsAtOffset = foldings.GetFoldingsAt(offset);
            //    FoldingSection collapsedSection = foldingsAtOffset.FirstOrDefault(section => section.IsFolded);

            //    if (collapsedSection != null)
            //    {
            //        args.SetToolTip(GetTooltipTextForCollapsedSection(args, collapsedSection));
            //    }
            //}

            var markersAtOffset   = _textMarkerService.GetMarkersAtOffset(offset);
            var markerWithToolTip = markersAtOffset.FirstOrDefault(marker => marker.ToolTip != null);

            if (markerWithToolTip != null)
            {
                args.SetToolTip(markerWithToolTip.ToolTip);
            }
        }
Ejemplo n.º 2
0
        private void EditorOnToolTipRequest(object sender, ToolTipRequestEventArgs args)
        {
            var offset = _document.GetOffset(args.LogicalPosition);

            var markersAtOffset = GetMarkersAtOffset(offset);
            var markerWithToolTip = markersAtOffset.FirstOrDefault(marker => marker.ToolTip != null);

            if (markerWithToolTip != null)
            {
                args.SetToolTip(markerWithToolTip.ToolTip);
            }
        }
Ejemplo n.º 3
0
        private void EditorOnToolTipRequest(object sender, ToolTipRequestEventArgs args)
        {
            var offset = _document.GetOffset(args.LogicalPosition);

            var markersAtOffset   = GetMarkersAtOffset(offset);
            var markerWithToolTip = markersAtOffset.FirstOrDefault(marker => marker.ToolTip != null);

            if (markerWithToolTip != null)
            {
                args.SetToolTip(markerWithToolTip.ToolTip);
            }
        }
        public void HandleToolTipRequest(ToolTipRequestEventArgs args)
        {
            if (!args.InDocument) return;
            var offset = _editor.Document.GetOffset(args.LogicalPosition);

            //FoldingManager foldings = _editor.GetService(typeof(FoldingManager)) as FoldingManager;
            //if (foldings != null)
            //{
            //    var foldingsAtOffset = foldings.GetFoldingsAt(offset);
            //    FoldingSection collapsedSection = foldingsAtOffset.FirstOrDefault(section => section.IsFolded);

            //    if (collapsedSection != null)
            //    {
            //        args.SetToolTip(GetTooltipTextForCollapsedSection(args, collapsedSection));
            //    }
            //}

            var markersAtOffset = _textMarkerService.GetMarkersAtOffset(offset);
            var markerWithToolTip = markersAtOffset.FirstOrDefault(marker => marker.ToolTip != null);
            if (markerWithToolTip != null)
            {
                args.SetToolTip(markerWithToolTip.ToolTip);
            }
        }