In This Article

SyntaxLanguageDefinitionSerializer Class

Provides a class that can deserialize a SyntaxLanguage from XML.

public class SyntaxLanguageDefinitionSerializer
Inheritance:
object object

Constructors

SyntaxLanguageDefinitionSerializer()

Initializes an instance of the class.

public SyntaxLanguageDefinitionSerializer()

Properties

HighlightingStyleRegistry

Gets or sets the custom IHighlightingStyleRegistry that should be used.

public IHighlightingStyleRegistry HighlightingStyleRegistry { get; set; }

Property Value

IHighlightingStyleRegistry:

The custom IHighlightingStyleRegistry that should be used.

Remarks

If this property is null, the AmbientHighlightingStyleRegistry will be used.

UseBuiltInClassificiationTypes

Gets or sets if a deserialized IClassificationType should attempt to use one of the built-in ClassificationTypes and its default IHighlightingStyle if one is available whose key matches the deserialized key.

public bool UseBuiltInClassificiationTypes { get; set; }

Property Value

bool:

true to attempt to use ClassificationTypes; otherwise, false to create a new IClassificationType. The default value is false.

Remarks

This property has no effect if the HighlightingStyleRegistry has already registered a IClassificationType with the same key.

Methods

InitializeFromFile(ISyntaxLanguage, string)

Initializes an existing ISyntaxLanguage from a language definition file.

public void InitializeFromFile(ISyntaxLanguage language, string path)
Parameter Type Description
language ISyntaxLanguage

The existing ISyntaxLanguage to initialize.

path string

The full path to the file.

InitializeFromStream(ISyntaxLanguage, Stream)

Initializes an existing ISyntaxLanguage from a language definition Stream.

public void InitializeFromStream(ISyntaxLanguage language, Stream stream)
Parameter Type Description
language ISyntaxLanguage

The existing ISyntaxLanguage to initialize.

stream Stream

The Stream from which to load.

LoadFromFile(string)

Loads an ISyntaxLanguage from a language definition file.

public ISyntaxLanguage LoadFromFile(string path)
Parameter Type Description
path string

The full path to the file.

Returns

ISyntaxLanguage:

The ISyntaxLanguage that was loaded.

LoadFromStream(Stream)

Loads an ISyntaxLanguage from a language definition Stream.

public ISyntaxLanguage LoadFromStream(Stream stream)
Parameter Type Description
stream Stream

The Stream from which to load.

Returns

ISyntaxLanguage:

The ISyntaxLanguage that was loaded.

Inherited Members