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

adding lexem programmatically when using Custom Language Configuration File

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? 

6 Replies

JV John van der Putte 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?


KP Kanniyappan Panneer Selvam Syncfusion Team 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. 
 
Regards, 
Kanniyappan P 



JV John van der Putte 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
Me.edcCODE.Language.Lexems.Remove
but I don't know what should be placed after remove.


JP Jagadeesan Pichaimuthu Syncfusion Team 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: 
Me.editControl1.Language.Lexems.Remove(own_lexem) 
   
Screenshot:  
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. 
 
Regards, 
Jagadeesan


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

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


FP Farjana Parveen Ayubb Syncfusion Team 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. 
 
Regards, 
Farjana Parveen A 


Loader.
Live Chat Icon For mobile
Up arrow icon