Exemple #1
0
 void TriggerQuickInfo()
 {
     if (quickInfoSession != null)
     {
         quickInfoSession.Dismissed -= QuickInfoSession_Dismissed;
         quickInfoSession.Dismiss();
         quickInfoSession = null;
     }
     quickInfoSession = quickInfoBroker.TriggerQuickInfo(hexView, hexView.Caret.Position.Position.ActivePosition, false);
     if (quickInfoSession?.IsDismissed == false)
     {
         quickInfoSession.Dismissed += QuickInfoSession_Dismissed;
     }
     else
     {
         quickInfoSession = null;
     }
 }
Exemple #2
0
        bool VSLI.IIntellisenseCommandTarget.ExecuteKeyboardCommand(VSLI.IntellisenseKeyboardCommand command)
        {
            switch (command)
            {
            case VSLI.IntellisenseKeyboardCommand.Escape:
                session.Dismiss();
                return(true);

            case VSLI.IntellisenseKeyboardCommand.Up:
            case VSLI.IntellisenseKeyboardCommand.Down:
            case VSLI.IntellisenseKeyboardCommand.PageUp:
            case VSLI.IntellisenseKeyboardCommand.PageDown:
            case VSLI.IntellisenseKeyboardCommand.Home:
            case VSLI.IntellisenseKeyboardCommand.End:
            case VSLI.IntellisenseKeyboardCommand.TopLine:
            case VSLI.IntellisenseKeyboardCommand.BottomLine:
            case VSLI.IntellisenseKeyboardCommand.Enter:
            case VSLI.IntellisenseKeyboardCommand.IncreaseFilterLevel:
            case VSLI.IntellisenseKeyboardCommand.DecreaseFilterLevel:
            default:
                return(false);
            }
        }
        public HexQuickInfoPresenter(HexQuickInfoSession session)
            : base(session)
        {
            wpfHexView = session.HexView as WpfHexView;
            Debug.Assert(wpfHexView != null);
            popup = new Popup {
                PlacementTarget     = wpfHexView?.VisualElement,
                Placement           = PlacementMode.Relative,
                Visibility          = Visibility.Collapsed,
                IsOpen              = false,
                AllowsTransparency  = true,
                UseLayoutRounding   = true,
                SnapsToDevicePixels = true,
            };

            // It's possible that quick info gets triggered inside the space between two values but
            // the full span doesn't include that space. In that case, dismiss the session.
            var mousePos = GetMousePoint(Mouse.PrimaryDevice);

            if (mousePos == null || !IsMouseWithinSpan(mousePos.Value))
            {
                session.Dismiss();
            }
        }