Example #1
0
            public ScrollbarColorProvider(ctrlSourceViewer viewer)
            {
                _viewer = viewer;

                DebugInfo info = ConfigManager.Config.DebugInfo;
                int       len  = viewer.ctrlCodeViewer.LineCount;

                int[]             relativeAddresses = new int[len];
                AddressTypeInfo[] addressInfo       = new AddressTypeInfo[len];
                for (int i = 0; i < len; i++)
                {
                    addressInfo[i] = _viewer.GetAddressInfo(i);
                    if (addressInfo[i].Address >= 0)
                    {
                        relativeAddresses[i] = InteropEmu.DebugGetRelativeAddress((uint)addressInfo[i].Address, AddressType.PrgRom);
                    }
                    else
                    {
                        relativeAddresses[i] = -1;
                    }
                }

                foreach (Breakpoint breakpoint in BreakpointManager.Breakpoints)
                {
                    for (int i = 0; i < len; i++)
                    {
                        if (breakpoint.Matches(relativeAddresses[i], addressInfo[i]))
                        {
                            Color bpColor = breakpoint.BreakOnExec ? info.CodeExecBreakpointColor : (breakpoint.BreakOnWrite ? info.CodeWriteBreakpointColor : info.CodeReadBreakpointColor);
                            _breakpointColors[i] = bpColor;
                        }
                    }
                }
            }
Example #2
0
 public LineStyleProvider(ctrlSourceViewer viewer)
 {
     _viewer = viewer;
 }