Determining LineEndStyle from LoadFile

SyntaxEditor for Windows Forms Forum

Posted 19 years ago by JJC
Avatar
Is there any way to determine when loading a file in SyntaxEditor what the current LineEndStyle is? I want to allow the user to convert between the two, but I can't seem to find an ability to determine a file's current type.

Thanks,
John

Comments (5)

Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
SyntaxEditor will load either \n or \r\n delimited files and converts them internally to \n line ends. Then to get the text using one format or another, use Document.GetText and the GetSubstring also has overloads for specifying the format. However it doesn't tell you what format was loaded.


Actipro Software Support

Posted 19 years ago by JJC
Avatar
Could I put in a request then to have some way to determine a files original line end style?

Thanks,
John
Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
I suppose we could look at the first line break and see if there is an \r before it. Then return the proper LineEndStyle from LoadFile. Would that suffice?


Actipro Software Support

Posted 19 years ago by JJC
Avatar
Sounds good to me!

Thanks!
John
Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Ok it will be in the next release.


Actipro Software Support

The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.