In This Article

BuiltInClassificationTypeProvider Class

Represents a provider of built-in IClassificationType objects for language text and UI display items that can be registered to a IHighlightingStyleRegistry with default styles.

public class BuiltInClassificationTypeProvider : ClassificationTypeProviderBase
Inheritance:
object ClassificationTypeProviderBase object

Constructors

BuiltInClassificationTypeProvider(IHighlightingStyleRegistry?)

Represents a provider of built-in IClassificationType objects for language text and UI display items that can be registered to a IHighlightingStyleRegistry with default styles.

public BuiltInClassificationTypeProvider(IHighlightingStyleRegistry? targetRegistry = null)
Parameter Type Description
targetRegistry IHighlightingStyleRegistry

The IHighlightingStyleRegistry to use when registering classification types and highlighting styles.

Properties

BreakpointDisabled

The IClassificationType to use for a disabled breakpoint.

public IClassificationType BreakpointDisabled { get; }

Property Value

IClassificationType

Remarks

Only the border is editable in the default IHighlightingStyle that is registered for this classification type.

BreakpointEnabled

The IClassificationType to use for an enabled breakpoint.

public IClassificationType BreakpointEnabled { get; }

Property Value

IClassificationType

Remarks

Only the foreground and background are editable in the default IHighlightingStyle that is registered for this classification type.

CaretPrimary

The IClassificationType to use for the primary caret when multiple carets are active.

public IClassificationType CaretPrimary { get; }

Property Value

IClassificationType

Remarks

Only the foreground is editable in the default IHighlightingStyle that is registered for this classification type.

CaretSecondary

The IClassificationType to use for a secondary caret when multiple carets are active.

public IClassificationType CaretSecondary { get; }

Property Value

IClassificationType

Remarks

Only the foreground is editable in the default IHighlightingStyle that is registered for this classification type.

CodeSnippetDependentField

The IClassificationType to use for a code snippet dependent field.

public IClassificationType CodeSnippetDependentField { get; }

Property Value

IClassificationType

Remarks

Only the border is editable in the default IHighlightingStyle that is registered for this classification type.

CodeSnippetField

The IClassificationType to use for a code snippet field.

public IClassificationType CodeSnippetField { get; }

Property Value

IClassificationType

Remarks

Only the background is editable in the default IHighlightingStyle that is registered for this classification type.

CollapsedText

The IClassificationType to use for collapsed text.

public IClassificationType CollapsedText { get; }

Property Value

IClassificationType

Remarks

Only the foreground is editable in the default IHighlightingStyle that is registered for this classification type.

CollapsibleRegion

The IClassificationType to use for collapsible regions.

public IClassificationType CollapsibleRegion { get; }

Property Value

IClassificationType

Remarks

Only the foreground and background are editable in the default IHighlightingStyle that is registered for this classification type.

ColumnGuides

The IClassificationType to use for column guides.

public IClassificationType ColumnGuides { get; }

Property Value

IClassificationType

Remarks

Only the background is editable in the default IHighlightingStyle that is registered for this classification type.

Comment

The IClassificationType to use for a general comment.

public IClassificationType Comment { get; }

Property Value

IClassificationType

Remarks

The first time this IClassificationType is accessed, it will be registered in the configured IHighlightingStyleRegistry with a default style if one is not already registered.

CompilerError

The IClassificationType to use for a compiler error.

public IClassificationType CompilerError { get; }

Property Value

IClassificationType

Remarks

The first time this IClassificationType is accessed, it will be registered in the configured IHighlightingStyleRegistry with a default style if one is not already registered.

CurrentLine

The IClassificationType to use for a current line highlight.

public IClassificationType CurrentLine { get; }

Property Value

IClassificationType

Remarks

Only the background and border are editable in the default IHighlightingStyle that is registered for this classification type.

CurrentStatement

The IClassificationType to use for a current statement.

public IClassificationType CurrentStatement { get; }

Property Value

IClassificationType

Remarks

Only the foreground and background are editable in the default IHighlightingStyle that is registered for this classification type.

DelimiterMatching

The IClassificationType to use for a delimiter match highlight.

public IClassificationType DelimiterMatching { get; }

Property Value

IClassificationType

Remarks

Only the background is editable in the default IHighlightingStyle that is registered for this classification type.

FindMatchHighlight

The IClassificationType to use for a find match highlight.

public IClassificationType FindMatchHighlight { get; }

Property Value

IClassificationType

Remarks

Only the background is editable in the default IHighlightingStyle that is registered for this classification type.

FindScopeHighlight

The IClassificationType to use for a find scope highlight.

public IClassificationType FindScopeHighlight { get; }

Property Value

IClassificationType

Remarks

Only the background is editable in the default IHighlightingStyle that is registered for this classification type.

Identifier

The IClassificationType to use for a general identifier.

public IClassificationType Identifier { get; }

Property Value

IClassificationType

Remarks

The first time this IClassificationType is accessed, it will be registered in the configured IHighlightingStyleRegistry with a default style if one is not already registered.

InactiveSelectedText

The IClassificationType to use for inactive selected text.

public IClassificationType InactiveSelectedText { get; }

Property Value

IClassificationType

Remarks

Only the background is editable in the default IHighlightingStyle that is registered for this classification type.

IndentationGuides

The IClassificationType to use for indentation guides.

public IClassificationType IndentationGuides { get; }

Property Value

IClassificationType

Remarks

Only the background is editable in the default IHighlightingStyle that is registered for this classification type.

IndicatorMargin

The IClassificationType to use for the indicator margin.

public IClassificationType IndicatorMargin { get; }

Property Value

IClassificationType

Remarks

Only the background is editable in the default IHighlightingStyle that is registered for this classification type.

Keyword

The IClassificationType to use for a general keyword.

public IClassificationType Keyword { get; }

Property Value

IClassificationType

Remarks

The first time this IClassificationType is accessed, it will be registered in the configured IHighlightingStyleRegistry with a default style if one is not already registered.

LineNumberCurrent

The IClassificationType to use for line numbers.

public IClassificationType LineNumberCurrent { get; }

Property Value

IClassificationType

Remarks

Only the foreground and background are editable in the default IHighlightingStyle that is registered for this classification type.

LineNumbers

The IClassificationType to use for line numbers.

public IClassificationType LineNumbers { get; }

Property Value

IClassificationType

Remarks

Only the foreground and background are editable in the default IHighlightingStyle that is registered for this classification type.

Number

The IClassificationType to use for a general number.

public IClassificationType Number { get; }

Property Value

IClassificationType

Remarks

The first time this IClassificationType is accessed, it will be registered in the configured IHighlightingStyleRegistry with a default style if one is not already registered.

Operator

The IClassificationType to use for a general operator.

public IClassificationType Operator { get; }

Property Value

IClassificationType

Remarks

The first time this IClassificationType is accessed, it will be registered in the configured IHighlightingStyleRegistry with a default style if one is not already registered.

OtherError

The IClassificationType to use for an other error.

public IClassificationType OtherError { get; }

Property Value

IClassificationType

Remarks

The first time this IClassificationType is accessed, it will be registered in the configured IHighlightingStyleRegistry with a default style if one is not already registered.

OutliningMarginSquare

The IClassificationType to use for outlining margin indicators.

public IClassificationType OutliningMarginSquare { get; }

Property Value

IClassificationType

Remarks

Only the foreground and background are editable in the default IHighlightingStyle that is registered for this classification type.

OutliningMarginVerticalRule

The IClassificationType to use for outlining margin vertical rules.

public IClassificationType OutliningMarginVerticalRule { get; }

Property Value

IClassificationType

Remarks

Only the foreground is editable in the default IHighlightingStyle that is registered for this classification type.

PlainText

The IClassificationType to use for plain text.

public IClassificationType PlainText { get; }

Property Value

IClassificationType

Remarks

Only the foreground and background are editable in the default IHighlightingStyle that is registered for this classification type.

PreprocessorKeyword

The IClassificationType to use for a general preprocessor keyword.

public IClassificationType PreprocessorKeyword { get; }

Property Value

IClassificationType

Remarks

The first time this IClassificationType is accessed, it will be registered in the configured IHighlightingStyleRegistry with a default style if one is not already registered.

Punctuation

The IClassificationType to use for general punctuation.

public IClassificationType Punctuation { get; }

Property Value

IClassificationType

Remarks

The first time this IClassificationType is accessed, it will be registered in the configured IHighlightingStyleRegistry with a default style if one is not already registered.

ReadOnlyRegion

The IClassificationType to use for a read-only region.

public IClassificationType ReadOnlyRegion { get; }

Property Value

IClassificationType

Remarks

The first time this IClassificationType is accessed, it will be registered in the configured IHighlightingStyleRegistry with a default style if one is not already registered.

RevertedChangesMark

The IClassificationType to use for reverted changes marks.

public IClassificationType RevertedChangesMark { get; }

Property Value

IClassificationType

Remarks

Only the background is editable in the default IHighlightingStyle that is registered for this classification type.

SavedChangesMark

The IClassificationType to use for saved changes marks.

public IClassificationType SavedChangesMark { get; }

Property Value

IClassificationType

Remarks

Only the background is editable in the default IHighlightingStyle that is registered for this classification type.

SecondaryText

The IClassificationType to use for secondary text.

public IClassificationType SecondaryText { get; }

Property Value

IClassificationType

Remarks

Only the foreground is editable in the default IHighlightingStyle that is registered for this classification type.

SelectedText

The IClassificationType to use for selected text.

public IClassificationType SelectedText { get; }

Property Value

IClassificationType

Remarks

Only the background is editable in the default IHighlightingStyle that is registered for this classification type.

String

The IClassificationType to use for a general string.

public IClassificationType String { get; }

Property Value

IClassificationType

Remarks

The first time this IClassificationType is accessed, it will be registered in the configured IHighlightingStyleRegistry with a default style if one is not already registered.

SyntaxError

The IClassificationType to use for a syntax error.

public IClassificationType SyntaxError { get; }

Property Value

IClassificationType

Remarks

The first time this IClassificationType is accessed, it will be registered in the configured IHighlightingStyleRegistry with a default style if one is not already registered.

Type

The IClassificationType to use for a type.

public IClassificationType Type { get; }

Property Value

IClassificationType

Remarks

The first time this IClassificationType is accessed, it will be registered in the configured IHighlightingStyleRegistry with a default style if one is not already registered.

UnsavedChangesMark

The IClassificationType to use for unsaved changes marks.

public IClassificationType UnsavedChangesMark { get; }

Property Value

IClassificationType

Remarks

Only the background is editable in the default IHighlightingStyle that is registered for this classification type.

VisibleWhitespace

The IClassificationType to use for visible whitespace.

public IClassificationType VisibleWhitespace { get; }

Property Value

IClassificationType

Remarks

Only the foreground is editable in the default IHighlightingStyle that is registered for this classification type.

Warning

The IClassificationType to use for a warning.

public IClassificationType Warning { get; }

Property Value

IClassificationType

Remarks

The first time this IClassificationType is accessed, it will be registered in the configured IHighlightingStyleRegistry with a default style if one is not already registered.

WordWrapGlyph

The IClassificationType to use for the word wrap glyph.

public IClassificationType WordWrapGlyph { get; }

Property Value

IClassificationType

Remarks

Only the foreground is editable in the default IHighlightingStyle that is registered for this classification type.

Methods

CreateDarkColorPalette()

Creates a color palette of default colors for use with a dark theme.

protected override IHighlightingStyleColorPalette CreateDarkColorPalette()

Returns

IHighlightingStyleColorPalette:

An IHighlightingStyleColorPalette instance representing the dark color palette.

Remarks

The default implementation of this method returns an empty DarkHighlightingStyleColorPalette instance, with the intention of the colors in the light color palette being adapted to dark colors automatically. Override this method to use specific dark colors instead of adapted colors.

CreateLightColorPalette()

Creates a color palette of default colors for use with a light theme.

protected override IHighlightingStyleColorPalette CreateLightColorPalette()

Returns

IHighlightingStyleColorPalette:

An IHighlightingStyleColorPalette instance representing the light color palette.

GetDefaultBackgroundColor(string, bool?)

Returns a default background color appropriate for the current theme, if available.

public static Color? GetDefaultBackgroundColor(string key, bool? isDarkTheme = null)
Parameter Type Description
key string

The color key (typically from DisplayItemClassificationTypeKeys).

isDarkTheme bool?

Indicates if a dark theme should be used for the default color. When null, IsDarkThemeActive will be used.

Returns

Color?:

The default background color appropriate for the current theme; or null if a default color is not available.

GetDefaultBorderColor(string, bool?)

Returns a default border color appropriate for the current theme, if available.

public static Color? GetDefaultBorderColor(string key, bool? isDarkTheme = null)
Parameter Type Description
key string

The color key (typically from DisplayItemClassificationTypeKeys).

isDarkTheme bool?

Indicates if a dark theme should be used for the default color. When null, IsDarkThemeActive will be used.

Returns

Color?:

The default border color appropriate for the current theme; or null if a default color is not available.

GetDefaultForegroundColor(string, bool?)

Returns a default foreground color appropriate for the current theme.

public static Color? GetDefaultForegroundColor(string key, bool? isDarkTheme = null)
Parameter Type Description
key string

The color key (typically from DisplayItemClassificationTypeKeys).

isDarkTheme bool?

Indicates if a dark theme should be used for the default color. When null, IsDarkThemeActive will be used.

Returns

Color?:

The default foreground color appropriate for the current theme; or null if a default color is not available.

GetLanguageTextClassificationType(string)

Returns the language text-related IClassificationType, if any, for the given key.

public IClassificationType? GetLanguageTextClassificationType(string key)
Parameter Type Description
key string

The key of the common IClassificationType.

Returns

IClassificationType:

The corresponding IClassificationType if found; otherwise null.

Remarks

The first time a IClassificationType is accessed, it will be registered in the configured target IHighlightingStyleRegistry with a default style if one is not already registered.

RegisterAll()

Registers all classification types and highlighting styles with the IHighlightingStyleRegistry used by this class.

public override IEnumerable<IClassificationType> RegisterAll()

Returns

IEnumerable<IClassificationType>:

The collection of IClassificationType objects that were registered.

RegisterDisplayItems()

Registers all display-related classification types and highlighting styles with the IHighlightingStyleRegistry used by this class.

public IEnumerable<IClassificationType> RegisterDisplayItems()

Returns

IEnumerable<IClassificationType>:

The collection of IClassificationType objects that were registered.

RegisterLanguageTextItems()

Registers all language text classification types and highlighting styles with the IHighlightingStyleRegistry used by this class.

public IEnumerable<IClassificationType> RegisterLanguageTextItems()

Returns

IEnumerable<IClassificationType>:

The collection of IClassificationType objects that were registered.

Inherited Members

Extension Methods