Class
CodeFormatter

Represents a formatter for code elements in Telerik's document model.

Definition

Namespace:Telerik.Windows.Documents.Model.Code

Assembly:Telerik.Windows.Controls.RichTextBox.dll

Syntax:

cs-api-definition
public class CodeFormatter

Inheritance: objectCodeFormatter

Constructors

CodeFormatter()

Declaration

cs-api-definition
public CodeFormatter()

Methods

GetCodeLanguages()

Gets all registered the code languages.

Declaration

cs-api-definition
public IEnumerable<CodeLanguage> GetCodeLanguages()

Returns

IEnumerable<CodeLanguage>

GetFormattedFragment(string, CodeFormattingSettings)

Creates fragment containing formatted code block.

Declaration

cs-api-definition
public DocumentFragment GetFormattedFragment(string code, CodeFormattingSettings settings)

Parameters

code

string

The code.

settings

CodeFormattingSettings

The settings.

Returns

DocumentFragment

DocumentFragments with formatted code block

RegisterClassificationType(ClassificationType, CodeLanguage, StyleDefinition)

Registers classification type for a specific code language and its corresponding style.

Declaration

cs-api-definition
public void RegisterClassificationType(ClassificationType type, CodeLanguage codeLanguage, StyleDefinition styleDefinition)

Parameters

type

ClassificationType

The type.

codeLanguage

CodeLanguage

The code language.

styleDefinition

StyleDefinition

The style definition.

RegisterClassificationType(ClassificationType, StyleDefinition)

Registers classification type and its corresponding style.

Declaration

cs-api-definition
public void RegisterClassificationType(ClassificationType type, StyleDefinition styleDefinition)

Parameters

type

ClassificationType

The classification type.

styleDefinition

StyleDefinition

The style definition.

RegisterCodeLanguage(CodeLanguage, ITagger<ClassificationTag>)

Registers a code language and its corresponding tagger.

Declaration

cs-api-definition
public void RegisterCodeLanguage(CodeLanguage codeLanguage, ITagger<ClassificationTag> tagger)

Parameters

codeLanguage

CodeLanguage

The code language.

tagger

ITagger<ClassificationTag>

The tagger.

UnregisterClassificationType(ClassificationType)

Unregisters classification type and its corresponding style.

Declaration

cs-api-definition
public void UnregisterClassificationType(ClassificationType type)

Parameters

type

ClassificationType

The classification type.

UnregisterClassificationType(ClassificationType, CodeLanguage)

Unregisters classification type for a specific code language and its corresponding style.

Declaration

cs-api-definition
public void UnregisterClassificationType(ClassificationType type, CodeLanguage codeLanguage)

Parameters

type

ClassificationType

The type.

codeLanguage

CodeLanguage

The code language.

UnregisterCodeLanguage(CodeLanguage)

Unregisters a code language and its corresponding tagger.

Declaration

cs-api-definition
public void UnregisterCodeLanguage(CodeLanguage codeLanguage)

Parameters

codeLanguage

CodeLanguage

The code language.