New build released

We (That's me and Christian Nordbakk) have released a new build of AylarSolutions.Highlight. The download URL is the same as for the previous release, but for those who don't feel like digging through old posts for information, you can get it here

The biggest change you will encounter, is the fact that the default location for the configuration file is now in the running application's \bin folder, and the config file has changed name from Languages.xml to Definitions.xml. This name change was done to make sure the component is as generic as possible.
Another constructor for the Highlighter class has been added. This new constructor takes a XmlDocument as a parameter, which means you can eg. load the configuration from a MS SQL server into an XmlDocument object and pass it into the constructor.
The last major change is that we changed the PerformCodeHighlight method to Highlight, and that we removed the OutputType parameter from the method. This parameter is now a class level property of the Highlighter class

Enjoy!

Published Tuesday, August 26, 2003 12:52 AM by Aylar

Comments

# re: New build released

Monday, January 12, 2004 6:35 AM by Clausen
Hi there,

I'm trying to use your code in win32 app that lets you locate a file and then writes the encoded file to an HTML file, but the output only escapes the html chars in the file - the code isn't encoded...am I missing something?

Here's what I do (the openFileDialog is where you choose the file to encode):

String config = @"C:\StudioProjects\SyntaxEncoder\SyntaxEncoder\support\Definitions.xml";
Highlighter hltr = new Highlighter();
hltr.OutputType = AylarSolutions.Highlight.Components.OutputType.Html;

Stream str = openFileDialog1.OpenFile();
StreamReader sr = new StreamReader(str);

String encoded = hltr.Highlight(sr.ReadToEnd(), config);

FileStream fs = File.OpenWrite(@"c:\tmp\encoded.code.html");
StreamWriter sw = new StreamWriter(fs);
sw.Write(encoded);
sw.Flush();
sw.Close();

Leave a Comment

(required) 
(required) 
(optional)
(required)