ClassificationTypeProviderBase Class
An abstract base class of an IClassificationType provider.
public abstract class ClassificationTypeProviderBase
- Inheritance:
- object object
- Derived:
- DotNetClassificationTypeProvider JavaScriptClassificationTypeProvider PythonClassificationTypeProvider XmlClassificationTypeProvider BuiltInClassificationTypeProvider
Constructors
ClassificationTypeProviderBase(IHighlightingStyleRegistry?)
Initializes an instance of the class.
protected ClassificationTypeProviderBase(IHighlightingStyleRegistry? targetRegistry = null)
| Parameter | Type | Description |
|---|---|---|
| targetRegistry | IHighlightingStyleRegistry | The IHighlightingStyleRegistry to use when registering classification types and highlighting styles. |
Properties
DefaultDarkColors
The cached IHighlightingStyleColorPalette containing default colors for use with a dark theme.
protected IHighlightingStyleColorPalette DefaultDarkColors { get; }
Property Value
See Also
DefaultLightColors
The cached IHighlightingStyleColorPalette containing default colors for use with a light theme.
protected IHighlightingStyleColorPalette DefaultLightColors { get; }
Property Value
See Also
TargetRegistry
The IHighlightingStyleRegistry to use when registering classification types and highlighting styles.
Methods
CreateDarkColorPalette()
Creates a color palette of default colors for use with a dark theme.
protected virtual 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 abstract IHighlightingStyleColorPalette CreateLightColorPalette()
Returns
- IHighlightingStyleColorPalette:
An IHighlightingStyleColorPalette instance representing the light color palette.
GetOrRegisterClassificationType(IClassificationType, bool, bool, bool, LineKind, HighlightingStyleBorderCornerKind, bool, bool?, bool, bool?, LineKind, bool)
Returns an IClassificationType from the TargetRegistry, registering one if one does not already exist with the same key
protected IClassificationType GetOrRegisterClassificationType(IClassificationType classificationType, bool isForegroundEditable = false, bool isBackgroundEditable = false, bool isBorderEditable = false, LineKind borderLineKind = LineKind.None, HighlightingStyleBorderCornerKind borderCornerKind = HighlightingStyleBorderCornerKind.Square, bool isBoldEditable = false, bool? isBold = null, bool isItalicEditable = false, bool? isItalic = null, LineKind underlineKind = LineKind.None, bool backgroundSpansVirtualSpace = false)
| Parameter | Type | Description |
|---|---|---|
| classificationType | IClassificationType | The IClassificationType to register if no classification type with the same key is already registered. |
| isForegroundEditable | bool | Whether the foreground is editable. |
| isBackgroundEditable | bool | Whether the background is editable. |
| isBorderEditable | bool | Whether the border is editable. |
| borderLineKind | LineKind | The border line kind. |
| borderCornerKind | HighlightingStyleBorderCornerKind | The border corner kind. |
| isBoldEditable | bool | Whether the bold state is editable. |
| isBold | bool? | Whether the text should render in bold. |
| isItalicEditable | bool | Whether the italic state is editable. |
| isItalic | bool? | Whether the text should render in italic. |
| underlineKind | LineKind | The kind of underline. |
| backgroundSpansVirtualSpace | bool | Whether the background spans to the right edge of the editor view. |
Returns
- IClassificationType:
The IClassificationType registered in the TargetRegistry.
GetOrRegisterTextClassificationType(IClassificationType, bool?, bool?, bool)
Returns a text-related IClassificationType from the TargetRegistry, registering one if one does not already exist with the same key
protected IClassificationType GetOrRegisterTextClassificationType(IClassificationType classificationType, bool? isBold = null, bool? isItalic = null, bool backgroundSpansVirtualSpace = false)
| Parameter | Type | Description |
|---|---|---|
| classificationType | IClassificationType | The IClassificationType to register if no classification type with the same key is already registered. |
| isBold | bool? | Whether the text should render in bold. |
| isItalic | bool? | Whether the text should render in italic. |
| backgroundSpansVirtualSpace | bool | Whether the background spans to the right edge of the editor view. |
Returns
- IClassificationType:
The IClassificationType registered in the TargetRegistry.
Remarks
Text-related classification types support editing their foreground, background, bold, and italic properties.
RegisterAll()
Registers all classification types and highlighting styles with the IHighlightingStyleRegistry used by this class.
public abstract IEnumerable<IClassificationType> RegisterAll()
Returns
- IEnumerable<IClassificationType>:
The collection of IClassificationType objects that were registered.
Inherited Members
- object.GetType()
- object.MemberwiseClone()
- object.ToString()
- object.Equals(object)
- object.Equals(object, object)
- object.ReferenceEquals(object, object)
- object.GetHashCode()