In This Article

HighlightingStyleRegistryExtensions Class

Provides extension methods for IHighlightingStyleRegistry objects.

public static class HighlightingStyleRegistryExtensions
Inheritance:
object object

Methods

ApplyColorPaletteToStyle(IHighlightingStyleRegistry, IClassificationType)

Applies the currently configured IHighlightingStyleColorPalette to the IHighlightingStyle, if any, that is registered for the given IClassificationType.

public static void ApplyColorPaletteToStyle(this IHighlightingStyleRegistry registry, IClassificationType classificationType)
Parameter Type Description
registry IHighlightingStyleRegistry

The IHighlightingStyleRegistry.

classificationType IClassificationType

The registered IClassificationType.

Remarks

Foreground, Background, and BorderColor are only applied if the IHighlightingStyle allows the corresponding property to be edited (e.g., IsForegroundEditable).

Exceptions

Type Condition
ArgumentNullException
ArgumentException

ApplyColorPaletteToStyle(IHighlightingStyleRegistry, IHighlightingStyle, string)

Applies the currently configured IHighlightingStyleColorPalette to the given IHighlightingStyle based on the available colors for the given colorPaletteKey.

public static void ApplyColorPaletteToStyle(this IHighlightingStyleRegistry registry, IHighlightingStyle style, string colorPaletteKey)
Parameter Type Description
registry IHighlightingStyleRegistry

The IHighlightingStyleRegistry.

style IHighlightingStyle

The IHighlightingStyle to be configured.

colorPaletteKey string

The key to be used when looking up colors in the IHighlightingStyleColorPalette (e.g., an IClassificationType key).

Remarks

Foreground, Background, and BorderColor are only applied if the IHighlightingStyle allows the corresponding property to be edited (e.g., IsForegroundEditable).

Exceptions

Type Condition
ArgumentNullException
InvalidOperationException

Inherited Members