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
close icon

editcontrol language Syntax Highlighting in app.config

Hello,

I have to highlight the log runtime, so I have defined a new language in the config.xml . But config.xml is one more configuration file in my project. My question is, Can we write a ConfigLanguage section in a application configuration file (app.config or user.config if user) and howto do it.

thank you for your help!

P.s.: I don't find a ConfigLanguage herited from 'System.Configuration.IConfigurationSectionHandler'.

1 Reply

DU David Union November 20, 2006 04:58 AM UTC

editControl.Configurator.Open() can take a string. So you should be able to put the entire contents into some tags in the config section, read in that tag as an xml node of an xmldocument, and just use the .ToString() on that node as the input to this.

The other option, which I'm probably using, is to simply embed the xml as a resource in the project.

Add it to the project and set the property to 'embedded resource' in the IDE. Then you can keep the file separate and not have to distribute any other separate .xml file at all, it will be in the .exe or .dll of the project.

To get the file at runtime use:
Assembly.GetExecutingAssembly().GetManifestResourceStream()



>Hello,

I have to highlight the log runtime, so I have defined a new language in the config.xml . But config.xml is one more configuration file in my project. My question is, Can we write a ConfigLanguage section in a application configuration file (app.config or user.config if user) and howto do it.

thank you for your help!

P.s.: I don't find a ConfigLanguage herited from 'System.Configuration.IConfigurationSectionHandler'.

Loader.
Live Chat Icon For mobile
Up arrow icon