2010-03-09 56 views
2

有時,當我設置一個斷點,並開始從赤調試顏色變成橄欖忽略。什麼橄欖子彈上斷點手段SharpDevelop的

我想知道爲什麼發生這種情況,以及如何避免它在未來。

編輯:

只有當斷點設置的代碼註釋行它不發生的情況:

not commented olive bullet

回答

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

其中斷點設置你的行註釋掉。

+0

是的,它是評論,但我不認爲它的情況。 我做了快速測試和breakpointing註釋的代碼行似乎工作正常 - > http://imgur.com/ssV1W.png – Marek 2010-03-09 14:03:43

2

如果將程序編譯爲「發佈」,則會發生這種情況。