How to get the line number from the breakpoints?

SyntaxEditor for WPF Forum

Posted 7 years ago by nick wong
Version: 14.2.0610
Platform: .NET 4.5
Environment: Windows 8 (64-bit)
Avatar

Hi,

   I have a problem ,I 'am using your breakpoint sample in 'namespace ActiproSoftware.ProductSamples.SyntaxEditorSamples.QuickStart.IndicatorsDebugging', now I'd like to konw how to get the lines' number which were toggled as breakpoints. thanks.

 

nick

[Modified 7 years ago]

Comments (5)

Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

You can do code like this to get the lines:

foreach (var bp in document.IndicatorManager.Breakpoints.GetInstances()) {
	var line = bp.VersionRange.Translate(document.CurrentSnapshot).StartPosition.Line;
	...
}


Actipro Software Support

Posted 7 years ago by nick wong
Avatar

Thank you very much,it works. good product.

The latest build of this product (v21.1.1) was released 1 month ago, which was before the next post in this thread.
Posted 16 days ago by JP Garza
Avatar

Hello, I am calling the same function but it appears to return a line with an offset of 1. For example, my breakpoint is on line number 20, but this code returns line number 19. 

Any ideas?

Posted 16 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

Offsets and line/char (positions) are all zero-based.  Whereas the line number margin visually appends 1 for display purposes.

[Modified 16 days ago]


Actipro Software Support

Posted 16 days ago by JP Garza
Avatar

Okay, thanks for the quick response.

Add Comment

Please log in to a validated account to post comments.