Conversion from 3.1.0222 to 4.0.0280

SyntaxEditor for Windows Forms Forum

Posted 15 years ago by Walt Morrison
Version: 4.0.0280
Avatar
Converting a large project, I have 3 items left I can't work out.

1. SpanIndication.OnAdded - readme just says 'removed'. New SpanIndicator class has no events defined or overrides that look relevant

2. and 3. DynamicOutliningSyntaxLanguage.PreParse and PostParse. Not mentioned at all in readme or in How to upgrade docs. Again can't find anything that looks even close.

I am supporting someone elses code here so I freely admit to not being quite the expert on how to use this (yet) - learning as I go along ;-)

Comments (5)

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

1) There are events such as SyntaxEditor.DocumentIndicatorAdded you can use instead.

2/3) Any SyntaxLanguage-derived class has methods such as OnDocumentTextChanging and OnDocumentTextChanged that you can override. I believe those are what replaced the older methods.

Hope that helps!


Actipro Software Support

Posted 15 years ago by Walt Morrison
Avatar
OK fixed those 3 and the good old compiler found another 250 or so... gotta love it.

Mostly straightforward but this one is causing me problems

SyntaxLanguageEventArgs.Language.SemanticParser = myDynamicOutliningSyntaxLanguage;

myDynamicOutliningSyntaxLanguage is an instance of a class that inherits from DynamicOutliningSyntaxLanguage

SemanticLanguage is gone and the help says
"SemanticParser class
Removed the SemanticParser class. All the features of this class have been merged into the SyntaxLanguage class."

So how do I get DynamicOutliningSyntaxLanguage associated with the Language?
Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Walt,

The methods in the old SemanticParser class were moved to be merged into the SyntaxLanguage class. So SyntaxLanguage now has an AutomaticOutliningBehavior property, PerformAutomaticOutlining method, SetOutliningNodeCollapsedText method, etc.


Actipro Software Support

Posted 15 years ago by Walt Morrison
Avatar
I gather that but I still need to set the language of the SyntaxLanguage before those methods will work right? How else will the SyntaxLangauge know how to work?

I'm guessing that I'm not understanding what this code used to to... I'll go read some more help for a while.
Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Ok I think I see your confusion. Now you'd make a language class that inherits DynamicOutliningSyntaxLanguage. Look in our sample project at CSharpDynamicSyntaxLanguage.

Then in the dynamic language XML definition (like in the sample's ActiproSoftware.CSharp.xml file), in the root tag you'll see this attribute:
SyntaxLanguageTypeName="TestApplication.CSharpDynamicSyntaxLanguage, TestApplication"
So when you load that XML file, SyntaxEditro looks for the type "TestApplication.CSharpDynamicSyntaxLanguage" in assembly "TestApplication" and uses that class as code-behind.

Thus everything gets linked up.

Make sense now?


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.