コード例 #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);
            }
コード例 #2
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);
        }
コード例 #3
0
            void Timer_Tick(object sender, EventArgs e)
            {
                if (owner.IsClosed || !owner.VisualElement.IsVisible || position == null || !owner.BufferLines.BufferSpan.Contains(position.Value.Line.BufferSpan))
                {
                    ClearMouseHoverPositionAndStopTimer();
                    return;
                }
                Debug.Assert(timerStart != null);
                var list = GetHandlersToNotify();

                if (list != null)
                {
                    var mhe = new HexMouseHoverEventArgs(owner, position.Value.Line, position.Value.Column);
                    foreach (var h in list)
                    {
                        h.Raised = true;
                        h.Handler(owner, mhe);
                    }
                }
                UpdateTimer();
            }