Exemple #1
0
        void HexView_MouseHover(object sender, HexMouseHoverEventArgs e)
        {
            var             posInfo = e.Line.GetLinePositionInfo(e.TextPosition);
            HexCellPosition triggerPoint;

            if (posInfo.IsAsciiCell && posInfo.Cell.HasData)
            {
                triggerPoint = new HexCellPosition(HexColumnType.Ascii, posInfo.Cell.BufferStart, posInfo.CellPosition);
            }
            else if (posInfo.IsValueCell && posInfo.Cell.HasData)
            {
                triggerPoint = new HexCellPosition(HexColumnType.Values, hexView.BufferLines.GetValueBufferSpan(posInfo.Cell, posInfo.CellPosition).Start, posInfo.CellPosition);
            }
            else if (posInfo.IsValueCellSeparator && posInfo.Cell.HasData)
            {
                triggerPoint = new HexCellPosition(HexColumnType.Values, hexView.BufferLines.GetValueBufferSpan(posInfo.Cell, posInfo.Cell.CellSpan.Length - 1).Start, posInfo.Cell.CellSpan.Length - 1);
            }
            else
            {
                return;
            }

            var sessions = quickInfoBroker.GetSessions(hexView);

            foreach (var session in sessions)
            {
                if (Intersects(session.ApplicableToSpan, triggerPoint))
                {
                    return;
                }
                if (session.HasInteractiveContent)
                {
                    foreach (var o in session.QuickInfoContent)
                    {
                        var io = o as IHexInteractiveQuickInfoContent;
                        if (io == null)
                        {
                            continue;
                        }
                        if (io.KeepQuickInfoOpen || io.IsMouseOverAggregated)
                        {
                            return;
                        }
                    }
                }
            }
            foreach (var session in sessions)
            {
                session.Dismiss();
            }
            quickInfoBroker.TriggerQuickInfo(hexView, triggerPoint, trackMouse: true);
        }
Exemple #2
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;
     }
 }