IHighlightingStyleRegistry Interface
Provides the base requirements for a registry of IClassificationType to IHighlightingStyle mapping data.
public interface IHighlightingStyleRegistry : IClassificationTypeRegistry
Properties
ClassificationTypes
The collection of IClassificationType objects that have been registered.
ICollection<IClassificationType> ClassificationTypes { get; }
Property Value
See Also
CurrentColorPalette
The current palette of colors available for use with IHighlightingStyle objects in the registry.
IHighlightingStyleColorPalette CurrentColorPalette { get; set; }
Property Value
Remarks
The value of this property is typically alternated between the LightColorPalette and DarkColorPalette but does not have to match either instance.
See Also
DarkColorPalette
The palette of colors available for use with IHighlightingStyle objects in the registry when a dark theme is active.
IHighlightingStyleColorPalette DarkColorPalette { get; set; }
Property Value
See Also
Description
The description of the registry.
HighlightingStyles
The collection of IHighlightingStyle objects that have been registered.
ICollection<IHighlightingStyle> HighlightingStyles { get; }
Property Value
See Also
this[IClassificationType]
The IHighlightingStyle registered with the specified IClassificationType, if any.
IHighlightingStyle? this[IClassificationType classificationType] { get; }
| Parameter | Type | Description |
|---|---|---|
| classificationType | IClassificationType | The IClassificationType for which to search. |
Property Value
See Also
LightColorPalette
The palette of colors available for use with IHighlightingStyle objects in the registry when a light theme is active.
IHighlightingStyleColorPalette LightColorPalette { get; set; }
Property Value
See Also
UnusedRegionForegroundOpacity
The opacity to use for unused region foregrounds.
double UnusedRegionForegroundOpacity { get; set; }
Property Value
- double:
The default value is
0.7.
See Also
Methods
GetClassificationType(string)
The IClassificationType, if any, that has been registered with the specified key.
IClassificationType? GetClassificationType(string key)
| Parameter | Type | Description |
|---|---|---|
| key | string | The key for which to search. |
Returns
See Also
ImportHighlightingStyles(Stream)
Imports style settings from the specified Stream, containing XML.
bool ImportHighlightingStyles(Stream stream)
| Parameter | Type | Description |
|---|---|---|
| stream | Stream | The Stream from which to import. |
Returns
- bool:
trueif settings were imported; otherwise,false.
See Also
Register(IClassificationType, IHighlightingStyle, bool)
Adds an IHighlightingStyle into the registry, optionally overwriting any existing IHighlightingStyle registered with the same IClassificationType.
bool Register(IClassificationType classificationType, IHighlightingStyle style, bool overwriteExisting = false)
| Parameter | Type | Description |
|---|---|---|
| classificationType | IClassificationType | The IClassificationType with which to register the IHighlightingStyle. |
| style | IHighlightingStyle | The IHighlightingStyle to register. |
| overwriteExisting | bool | Whether to overwrite existing highlighting styles with the same IClassificationType. |
Returns
- bool:
trueif the IHighlightingStyle was added; otherwise,false.
Remarks
This method only returns false if overwriteExisting is false and there
is already an IHighlightingStyle registered with the same IClassificationType.
See Also
Unregister(IClassificationType)
Removes a registry entry with the specified IClassificationType from the registry and removes the corresponding colors from the color palettes.
bool Unregister(IClassificationType classificationType)
| Parameter | Type | Description |
|---|---|---|
| classificationType | IClassificationType | The IClassificationType to unregister. |
Returns
- bool:
trueif the registry entry was removed; otherwise,false.
See Also
Unregister(IClassificationType, bool)
Removes a registry entry with the specified IClassificationType from the registry with the option to also clear the corresponding colors from the LightColorPalette and DarkColorPalette.
bool Unregister(IClassificationType classificationType, bool keepColorPalettes)
| Parameter | Type | Description |
|---|---|---|
| classificationType | IClassificationType | The IClassificationType to unregister. |
| keepColorPalettes | bool |
|
Returns
- bool:
trueif the registry entry was removed; otherwise,false.
See Also
Events
Changed
Occurs after a change has occurred to the items in the registry.
Inherited Members
Extension Methods
- HighlightingStyleRegistryExtensions.ApplyColorPaletteToStyle(IHighlightingStyleRegistry, IClassificationType)
- HighlightingStyleRegistryExtensions.ApplyColorPaletteToStyle(IHighlightingStyleRegistry, IHighlightingStyle, string)
- ObjectExtensions.TryConvertToDouble(object, out double)
- ObjectExtensions.TryConvertToDouble(object, IFormatProvider, out double)