# Displaying Saved Breakpoints

**URL:** https://forum.alternetsoft.com/t/displaying-saved-breakpoints/72
**Category:** AlterNET Studio Support
**Tags:** scripter, editor
**Created:** [June 9, 2020, 12:00am UTC](https://forum.alternetsoft.com/t/displaying-saved-breakpoints/72 "2020-06-09T00:00:00Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![cgillin](https://forum.alternetsoft.com/letter_avatar_proxy/v4/letter/c/606060/32.png) [@cgillin](https://forum.alternetsoft.com/u/cgillin)
#### Post date: [June 9, 2020, 12:00am UTC](https://forum.alternetsoft.com/t/displaying-saved-breakpoints/72/1 "2020-06-09T00:00:00Z")

</div>

Hi -  
I am using the DebugEditControl and I'm saving the breakpoints when my application closes and re-setting them the next time it runs using:  
Editor.Debugger.Breakpoints.AddBreakpoint(file, line)   
I can see that the breakpoint exists in the collection after adding it, but it is not displayed on the screen. Is there a UI refresh method I should be calling after setting the breakpoints manually? I have tried using BeginUpdate and EndUpdate but it is still not working.  
Thanks!

---

<div class="post-metadata">

### Author: ![andrew.medvedev](https://forum.alternetsoft.com/user_avatar/forum.alternetsoft.com/andrew.medvedev/32/28_2.png) [@andrew.medvedev](https://forum.alternetsoft.com/u/andrew.medvedev)
#### Post date: [June 9, 2020, 12:00am UTC](https://forum.alternetsoft.com/t/displaying-saved-breakpoints/72/2 "2020-06-09T00:00:00Z")

</div>

Hi,  
you can use code like this:  
 private void ReloadBreakpointsFromDebugger(DebugCodeEdit edit)  
 {  
 foreach (Breakpoint bp in Debugger.Breakpoints.Breakpoints)  
 {  
 if (string.Compare(bp.FilePath, edit.FileName) == 0)  
 {  
 var parser = edit.Lexer as Alternet.Syntax.ISyntaxParser;  
  
 var range = parser?.GetActiveStatementAt(new Point(0, bp.LineNumber));  
  
 if ((range != null) && !range.IsEmpty)  
 edit.Source.LineStyles.SetLineStyle(range, -1, 1);  
 else  
 edit.Source.LineStyles.SetLineStyle(bp.LineNumber - 1, 1);  
 }  
 }  
 }  
Regards,  
Andrew
