ContentDivider working with C# language file (Redux)

SyntaxEditor for Windows Forms Forum

Posted 16 years ago by GeorgeNY - CTO, RatchetSoft, LLC
Avatar
Ok, i must be a dope... 'cause i can't this to work. A prior posting was vague, but pointed me in the direction of adding content dividers to my language definition xml file. I have not been successful as to date. Can anyone help.

Pertinent facts:

1) I am starting with the CSharp language file provided with samples
2) I would like to have content divider lines between each method of a class.
3) The class consists of 6 fixed methods and no properties.

Is this doable? Is it hard or easy? Any examples, tips or non-documented secrets that might help me?

Any help offered will be greatly appreciated.

George P Weihs

Comments (3)

Posted 16 years ago by Boyd - Sr. Software Developer, Patterson Consulting, LLC
Avatar
I haven't tried this with C#, but I can tell you that it probably won't be easy if possible at all. The trick to content dividers is that you need to be able to specify a specific matching pattern (in the XML file) that, when found, will have a content divider drawn below that line.

The problem with C# is that a method definition is ended by a "}" character. Of course, just about every other block of code is also ended by a "}" character. So the trick is getting it to draw a content divider below a "}" only if that marks the end of a method declaration (not for 'if' blocks and other code blocks). That's a hard pattern to match on.

From what I know about SyntaxEditor, I don't think this is feasible in the current version. It works well for languages like Visual Basic, but C# is hard.

Perhaps you could talk to Actipro Support about making some enhancements here. For instance, it's very limiting to only be able to define a content divider in an XML file. If we could programmatically specify the location of content dividers in a semantic parser (like we do with outlining nodes), they would be a lot more flexible.
Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Lets discuss this in the chat on Wednesday... right now content dividers are placed automatically on a display line when a token that requires them appears. Maybe we need to add something that lets you say whether a document line (as opposed to a display line) needs a content divider. And then whenever we do our routines for determining if a display line needs a divider, it can also check the flag on the associated document line. But in word wrap cases, it would only show the divider on the last display line for a document.


Actipro Software Support

Posted 16 years ago by Boyd - Sr. Software Developer, Patterson Consulting, LLC
Avatar
I like the idea of having two ways to get the content dividers. We'll chat more on Wednesday.
The latest build of this product (v21.1.0) was released 12 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.