How to get the line number from the breakpoints?

SyntaxEditor for WPF Forum

Posted 10 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 10 years ago]

Comments (5)

Posted 10 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 10 years ago by nick wong
Avatar

Thank you very much,it works. good product.

Posted 4 years 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 4 years 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 4 years ago]


Actipro Software Support

Posted 4 years ago by JP Garza
Avatar

Okay, thanks for the quick response.

The latest build of this product (v24.1.3) was released 24 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.