Syntax languages have the ability to expose a small code snippet showing many of the constructs in the language.
This can be used in options dialogs to show how the current classifications / syntax highlighting settings affect a particular language. In this case, it is best to use code that shows all the various classifications and related highlighting styles.
Basic Concepts
The IExample
The Example
Registering with a Language
Any object that implements IExample
This code creates XML example text and registers it with the syntax language that is already declared in the language
variable:
Note
The SyntaxActiproSoftware.Text
namespace is imported. See the Service Locator Architecture topic for details on registering and retrieving various service object instances, both via extension methods and generically, as there are some additional requirements for using the extension methods.