有时当我设置断点并开始调试其颜色从红色变为橄榄色时:
当它发生时,调试根本不会停止 - 忽略断点。
我想知道为什么会发生这种情况以及将来如何避免这种情况。
编辑:
只有在注释的代码行上设置断点时才会发生:
答案 0 :(得分:3)
它是开源的。下载并找到相关代码花了我大约5分钟:
public void DrawBreakpoint(Graphics g, int y, bool isEnabled, bool isHealthy)
{
int diameter = Math.Min(iconBarWidth - 2, textArea.TextView.FontHeight);
Rectangle rect = new Rectangle(1,
y + (textArea.TextView.FontHeight -
diameter) / 2,
diameter,
diameter);
using (GraphicsPath path = new GraphicsPath()) {
path.AddEllipse(rect);
using (PathGradientBrush pthGrBrush = new PathGradientBrush(path)) {
pthGrBrush.CenterPoint = new PointF(rect.Left + rect.Width / 3 ,
rect.Top + rect.Height / 3);
pthGrBrush.CenterColor = Color.MistyRose;
Color[] colors = {isHealthy ? Color.Firebrick : Color.Olive};
pthGrBrush.SurroundColors = colors;
if (isEnabled) {
g.FillEllipse(pthGrBrush, rect);
} else {
g.FillEllipse(SystemBrushes.Control, rect);
using (Pen pen = new Pen(pthGrBrush)) {
g.DrawEllipse(pen, new Rectangle(rect.X + 1, rect.Y + 1,
rect.Width - 2,
rect.Height - 2));
}
}
}
}
}
该圆圈颜色为“Color.Olive”。如果您想知道isHealthy
为何为假,请使用源代码。我可以快速找到几个原因:源文件已更改或模块未加载,可能还有更多。
答案 1 :(得分:2)
如果将程序编译为“release”,则会发生这种情况。
答案 2 :(得分:1)
在您设置断点的地方评论您的行。