We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

adding lexem programmatically when using Custom Language Configuration File

Thread ID:





146113 Jul 20,2019 03:05 PM UTC Jul 26,2019 05:48 AM UTC WinForms 6
Tags: EditControl
John van der Putte
Asked On July 20, 2019 03:05 PM UTC

is it possible to add and remove lexems programmatically in combination with a custum language configuration file?
if yes, can someone make a little exsample how to implement it? 

John van der Putte
Replied On July 22, 2019 10:14 AM UTC

I managed to add lexems programmaticallyy in combination with a custum langua configuration file : one problem solved.

I don't know how i can remove a lexem. p.e.: i have a lexem with ' BeginBlock="abcde" ' and i want it removed. how can i do it?

Kanniyappan Panneer Selvam [Syncfusion]
Replied On July 22, 2019 02:03 PM UTC

Hi John, 
Thanks for contacting the syncfusion support. 
Please refer the below UG link to configure the lexem programmatically in custom configuration file. 
Please try this above solution and let us know if it is helpful. 
Kanniyappan P 

John van der Putte
Replied On July 22, 2019 04:52 PM UTC

I looked at the given link. Some parts I have already used. My application uses an xml document for the ever-present lexems. For this I use the code:
edcCODE.Configurator.Open ("F: \ VB2010 Proj \ Private \ PRIDE \ PRIDE \ PRIDE.PLC") edcCODE.ApplyConfiguration ("PROTON") for the lexems that are named by the end user I use the following code to add this: Dim currentConfigLanguage As IConfigLanguage = Me.edcCODE.Configurator ("PROTON") Me.edcCODE.ApplyConfiguration (currentConfigLanguage) Dim formatMethod As ISnippetFormat = Me.edcCODE.Language.Add ("CodeBehind") formatMethod.Font = New Font ("Garamond", 12) formatMethod.BackColor = Color.Green Dim own_lexem As ConfigLexem = New ConfigLexem ("Graphic", "", FormatType.Custom, False) own_lexem.FormatName = "CodeBehind" Me.edcCODE.Language.Lexems.Add (own_lexem) Me.edcCODE.Language.ResetCaches () this works as desired. both the lexems from the xml file are processed as well as the lexems via the code. What I have a problem with is to remove a lexem that has been added via the code. I tried to remove a lexem via
but I don't know what should be placed after remove.

Jagadeesan Pichaimuthu [Syncfusion]
Replied On July 24, 2019 07:34 AM UTC

Hi John van, 
Thanks for your update. 
We have checked your query “How to remove the lexems”. We suggest you to remove the added ConfigLexem from the Lexems collections using Remove() method. We have prepared the sample based on your requirement. Please find the code snippet, screenshot and sample for the same. 
Code Snippet: 
Added the configured  lexem 
After removing the configured lexem 
If you still face the issues at your end, please modify the above sample to reproduce the reported issue. It would be more helpful to proceed further and resolve this issue as earlier. 

John van der Putte
Replied On July 25, 2019 10:23 AM UTC

thanks for the exsample. i managed to tackle my problem.

Farjana Parveen Ayubb [Syncfusion]
Replied On July 26, 2019 05:48 AM UTC

Hi John, 
Thanks for the update. 
We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help you. 
Farjana Parveen A 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon