I'm trying to set the Syntax Highlighting in my program I'm making that uses AvalonEdit
This is the code that I'm using:
StreamResourceInfo sri = Application.GetResourceStream(new Uri("lua.xshd"));
using (Stream s = sri.Stream)
{
using (XmlTextReader reader = new XmlTextReader(s))
{
var gLua = HighlightingLoader.LoadXshd(reader);
editor.SyntaxHighlighting = HighlightingLoader.Load(gLua, HighlightingManager.Instance);
editor.Text = reader.ToString();
}
}
I'm also getting
A first chance exception of type 'System.UriFormatException' occurred in System.dll
How should I change this to make it work?