Dynamic Additions to Pattern Group?

SyntaxEditor for Windows Forms Forum

Posted 13 years ago by Jerry
Avatar
This is a Pattern Group I am testing. How can I make additions to it on the fly?

For example it has Test1 and test2 but what if at run time I wanted to add Test3?

Can this be done?


<ExplicitPatternGroup TokenKey="ReservedWordMyToken" Style="ReservedWordMyStyle" LookBehind="[^\.]" LookAhead="{NonWordMacro}" CaseSensitivity="AutoCorrect">
<ExplicitPatterns>
Test1 test2
</ExplicitPatterns>
</ExplicitPatternGroup>

Comments (2)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Jerry,

You have to set the SyntaxLanguage.IsUpdating to true before making pattern changes. Then you get the language's state that contains the pattern group, find the pattern group within that, and add a new pattern to it. You can do that in the object model. Then when done, set SyntaxLanguage.IsUpdating back to false. That will reparse the document with your changes.


Actipro Software Support

Posted 13 years ago by Jerry
Avatar
Thanks!

Jerry

[Modified at 04/12/2006 07:29 PM]
The latest build of this product (v2018.1 build 0341) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.