Пример #1
0
        private void pushColor(Highlight highlight)
        {
            if (!oldHighlights.Keys.Contains(highlight.Address))
                oldHighlights.Add(highlight.Address, new Stack<Highlight>());

            oldHighlights[highlight.Address].Push(highlight);
            activeHighlights.Remove(highlight.Address);
        }
Пример #2
0
        private void changeColor(int startAddress, int length, Color foreColor, Color backColor)
        {
            if (this.hbMemory.InvokeRequired)
            {
                changeColorCallback c = new changeColorCallback(changeColor);
                this.Invoke(c, new object[] { startAddress, length, foreColor, backColor });
            }
            else
            {
                Highlight newhl = new Highlight(startAddress, length, foreColor, backColor);

                if (activeHighlights.Keys.Contains(startAddress))
                {
                    pushColor(activeHighlights[startAddress]);
                    hbMemory.RemoveHighlight(startAddress);
                    hbMemory.Invalidate();
                }

                hbMemory.AddHighlight(startAddress, length, foreColor, backColor);
                activeHighlights.Add(startAddress, newhl);

                hbMemory.Refresh();
            }
        }