This project is read-only.

[C#] How to get XML highlighting?

Jun 14, 2008 at 2:41 AM
Edited Jun 14, 2008 at 3:45 AM
What I have done:
I have the control on the stage. I'm able to edit text in it and save it.

I can't figure out how to set the syntax highlighting in it to XML.

Thanks guys and even though it may not sound like it I actually plan on learning this thing inside and out once I get the basics down (I tried to figure out how it works from FlashDevelops source like I did with DockPanel, but Mika is far to smart in his coding and organization so I get confused).

General Optional Questions:
I'm gonna try to download the newest version from the source files this time around as it looks way newer. Still the ancient VS 2005 Solution File... hmm. Upgrading it to a VS 2008 gives me a bunch of errors.

1. Should I wait till this is further in development?
2. It looks to be updated very recently yet all the files solutions are in VS 2005 and contain errors when upgrading or should I not be trying to use the latest builds?

(Tortoise SVN with the url: http://localhost:8081/ fails to work... might want to check that out).
Jun 14, 2008 at 4:36 PM
There's been numerous updates since the 2.0 release. I would recommend downloading the latest changeset (33924 at the moment) from the Source Control tab. Unzip the file and open with VS2008. It should go through the conversion process without a problem and build without any hitches.

You can learn how to do XML syntax highlighting by studying the SCide source code. It's very easy to follow.

Just remember that to run SCide (or ScintillaNET) you'll need a recent copy of the SciLexer.dll in your bin folder. You can download it from the Scintilla website or use the one in the ScintillaNET 2.0 release.


Jun 14, 2008 at 6:04 PM
Edited Jun 14, 2008 at 7:11 PM
Okay good got that to work it was because I had the ScintillaNET selected as the project instead of the SCide. Two questions and then I'm done till I have time to learn more of scintilla.

1. So I thought XML supported folding I can't figure out how to get folding to work (it doesn't work in SCide from what I can tell).
2. How exactly do I change the colours of the XML (the default ones are horribly ugly).

//edit, I can't compile ScintillaNET because of errors, so is there a way to put my own xml.xml file for a custom language in my project. I've noticed that it defines colours by "Orchid" where is the list of these colours if I was going to write this up myself? (If your wondering how I have the .dll you leave it in the debug folder so I just used that one).

Looking through flash develops source code they have a slick system for defining xml schemes.

Thanks man.
Jun 15, 2008 at 12:11 AM
One of the other guys with more experience might be able to answer your questions about customizing the XML syntax folding and colors. However, I'm curious as to why you cannot build the solution. Did you download the latest change-set from the Source Code tab? Did you open the solution or the project file? What exactly was the compilation error?


Jun 15, 2008 at 12:23 AM
Edited Jun 15, 2008 at 12:47 AM
nvm they were just warning I forgot that nothing happens when I build a .dll. I was thinking the warnings were stopping it and they were not.

So yea I'll just wait till someone comes along and describes how the Folding... but I won't put my hopes up to high as this sites traffic is probably pretty low.

The built in colours are below... but I just used the #HEX colours and it worked perfectly. :) Now to get folding to work.


Jul 29, 2008 at 6:23 AM
The trick to getting folding to work is to set the Lexer Property "fold.html" to "1". <sarcasm>Why couldn't you figure that out?? </sarcasm>. I've added this to the Folding.IsEnabled property so HTML/XML/SGML folding is enabled automagically. (Changeset 34533)