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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

JSon Language Configuration

Thread ID:





125305 Aug 7,2016 12:24 AM UTC Aug 10,2016 11:16 AM UTC WinForms 1
Tags: EditControl
Ron Milne
Asked On August 7, 2016 12:24 AM UTC

Does anyone have a language configuration for parsing Json files?

Venkateshwaran Ramdoss [Syncfusion]
Replied On August 10, 2016 11:16 AM UTC

Hi Ron, 
Thank you for contacting Syncfusion Support. 
The custom language can be configured in the EditControl by using the configuration file. By configuring the custom language in the EditControl, you can define the syntax coloring based on the requirement. The following steps help you to configure the syntax coloring for the Json language. 
Step 1(Initialize the configuration language): Set the configured language by using the ConfigLanguage tag attribute.  
For an example: <ConfigLanguage name="Json" StartComment="//" CaseInsensitive="true" >  
Step 2(Extensions): Extensions contain a list of extensions that are associated with that particular language. 
Step 3(Splits): Splits contain a list of expressions that must be treated as one word. “=” and “+” are splitters, by default. So, each of them are returned by the tokenizer as a single char. For example, when you want to specify a configuration for “+=”, you should specify “+=” in the splits section. 
Step 4(Formats): This section helps you to initialize the Format strings. The Format assigns the syntax coloring for the keywords, text, comment tag, etc. 
Step 5(Lexems): The Lexem contains rules for parsing the text. There are two attributes to specify the format of the lexem. 
·       Type: The Type is used for standard predefined types of the lexems. 
·       FormatName: The FormatName is used only when Type is Custom. 
Step 6(AutoReplaceTriggers): The AutoReplaceTrigger option helps you to autocorrect the mistakes in the EditControl. 
For an example:  
  <AutoReplaceTrigger From="slef" To="self" /> 
Step 7: After configuring the custom language, the configured file can be applied to the EditControl by using the Configurator.Open function in the EditControl. 
Step 8: The text coloring of the specified language can be applied to the EditControl by using the ApplyConfiguration function in the EditControl. 
For an example: 
// Opens the PowerShell file. 
//Configures the Custom Language File. 
//Applies the Custom Language configuration to the EditControl. 
You can refer the below KB link for brief explanation of syntax highlighting for Custom Language Configuration. 
KB Link:  
We have prepared a sample to Parsing Json language in EditControl using above stepsfor your reference and you can download the sample and screenshots from the below link.  
We request you to check with the above solution and let us know if it helps.  
Venkateshwaran V.R. 


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