Skip to content

Syntax highlighting

siegi44 edited this page Nov 20, 2007 · 7 revisions

Basics

The Texteditor uses socalled "XML Syntaxhightlighting Definition" (*.xshd) files to define a set of syntaxhighlighting rules.

Attach a syntaxhighlighting to the Text editor

To attach a syntaxhighlighting to the editor use following code: {{ string dir = "ressources\highlighting\"; // Insert the path to your xshd-files. FileSyntaxModeProvider fsmProvider; // Provider if (Directory.Exists(dir)) { fsmProvider = new FileSyntaxModeProvider(dir); // Create new provider with the highlighting directory. HighlightingManager.Manager.AddSyntaxModeFileProvider(fsmProvider); // Attach to the text editor. txtSQL.SetHighlighting("YourHighlighting"); // Activate the highlighting, use the name from the SyntaxDefinition node. } }}

Creating custom XSHD-Files

Clone this wiki locally