In This Article

HighlightingStyleColorPaletteBase Class

Represents a palette of colors to be used with a IHighlightingStyle.

public abstract class HighlightingStyleColorPaletteBase : IHighlightingStyleColorPalette
Inheritance:
object object
Derived:
DarkHighlightingStyleColorPalette LightHighlightingStyleColorPalette
Implements:
IHighlightingStyleColorPalette

Constructors

HighlightingStyleColorPaletteBase(string)

Initializes a new instance of the class.

public HighlightingStyleColorPaletteBase(string name)
Parameter Type Description
name string

The name of the color palette.

Exceptions

Type Condition
ArgumentNullException

Properties

Keys

An enumerable of keys currently associated with one or more colors.

public IEnumerable<string> Keys { get; }

Property Value

IEnumerable<string>

Name

The name of the color palette.

public string Name { get; }

Property Value

string

Methods

ClearAll()

Clears all colors defined in the color palette.

public void ClearAll()

ClearKey(string)

Clears all colors defined in the color palette for the given key.

public void ClearKey(string key)
Parameter Type Description
key string

The key, which is typically matches an IClassificationType key.

ContainsKey(string)

Tests if one or more colors are available for the given key.

public bool ContainsKey(string key)
Parameter Type Description
key string

The key, which is typically matches an IClassificationType key.

Returns

bool:

true if at least one color is available for the given key; otherwise false.

GetBackground(string)

Gets the background color, if any, associated with the given key.

public virtual Color? GetBackground(string key)
Parameter Type Description
key string

The key, which is typically matches an IClassificationType key.

Returns

Color?:

The background color for the given key, or null if a color is not defined for the key.

GetBorder(string)

Gets the border color, if any, associated with the given key.

public virtual Color? GetBorder(string key)
Parameter Type Description
key string

The key, which is typically matches an IClassificationType key.

Returns

Color?:

The border color for the given key, or null if a color is not defined for the key.

GetForeground(string)

Gets the foreground color, if any, associated with the given key.

public virtual Color? GetForeground(string key)
Parameter Type Description
key string

The key, which is typically matches an IClassificationType key.

Returns

Color?:

The foreground color for the given key, or null if a color is not defined for the key.

GetStrikethrough(string)

Gets the strikethrough color, if any, associated with the given key.

public virtual Color? GetStrikethrough(string key)
Parameter Type Description
key string

The key, which is typically matches an IClassificationType key.

Returns

Color?:

The strikethrough color for the given key, or null if a color is not defined for the key.

GetUnderline(string)

Gets the underline color, if any, associated with the given key.

public virtual Color? GetUnderline(string key)
Parameter Type Description
key string

The key, which is typically matches an IClassificationType key.

Returns

Color?:

The underline color for the given key, or null if a color is not defined for the key.

SetBackground(string, Color?)

Sets the background color, if any, to be associated with the given key. If the key is already assigned a color, it will not overwrite the existing color.

public bool SetBackground(string key, Color? color)
Parameter Type Description
key string

The key, which is typically matches an IClassificationType key.

color Color?

The color to be assigned.

Returns

bool:

true if the color was added; otherwise, false.

SetBackground(string, Color?, bool)

Sets the background color, if any, to be associated with the given key.

public bool SetBackground(string key, Color? color, bool overwriteExisting)
Parameter Type Description
key string

The key, which is typically matches an IClassificationType key.

color Color?

The color to be assigned.

overwriteExisting bool

true to overwrite any existing color already assigned for the same key; otherwise, false and the color will only be assigned if it is not currently assigned.

Returns

bool:

true if the color was added; otherwise, false.

SetBorder(string, Color?)

Sets the border color, if any, to be associated with the given key. If the key is already assigned a color, it will not overwrite the existing color.

public bool SetBorder(string key, Color? color)
Parameter Type Description
key string

The key, which is typically matches an IClassificationType key.

color Color?

The color to be assigned.

Returns

bool:

true if the color was added; otherwise, false.

SetBorder(string, Color?, bool)

Sets the border color, if any, to be associated with the given key.

public bool SetBorder(string key, Color? color, bool overwriteExisting)
Parameter Type Description
key string

The key, which is typically matches an IClassificationType key.

color Color?

The color to be assigned.

overwriteExisting bool

true to overwrite any existing color already assigned for the same key; otherwise, false and the color will only be assigned if it is not currently assigned.

Returns

bool:

true if the color was added; otherwise, false.

SetForeground(string, Color?)

Sets the foreground color, if any, to be associated with the given key. If the key is already assigned a color, it will not overwrite the existing color.

public bool SetForeground(string key, Color? color)
Parameter Type Description
key string

The key, which is typically matches an IClassificationType key.

color Color?

The color to be assigned.

Returns

bool:

true if the color was added; otherwise, false.

SetForeground(string, Color?, bool)

Sets the foreground color, if any, to be associated with the given key.

public bool SetForeground(string key, Color? color, bool overwriteExisting)
Parameter Type Description
key string

The key, which is typically matches an IClassificationType key.

color Color?

The color to be assigned.

overwriteExisting bool

true to overwrite any existing color already assigned for the same key; otherwise, false and the color will only be assigned if it is not currently assigned.

Returns

bool:

true if the color was added; otherwise, false.

SetStrikethrough(string, Color?)

Sets the strikethrough color, if any, to be associated with the given key. If the key is already assigned a color, it will not overwrite the existing color.

public bool SetStrikethrough(string key, Color? color)
Parameter Type Description
key string

The key, which is typically matches an IClassificationType key.

color Color?

The color to be assigned.

Returns

bool:

true if the color was added; otherwise, false.

SetStrikethrough(string, Color?, bool)

Sets the strikethrough color, if any, to be associated with the given key.

public bool SetStrikethrough(string key, Color? color, bool overwriteExisting)
Parameter Type Description
key string

The key, which is typically matches an IClassificationType key.

color Color?

The color to be assigned.

overwriteExisting bool

true to overwrite any existing color already assigned for the same key; otherwise, false and the color will only be assigned if it is not currently assigned.

Returns

bool:

true if the color was added; otherwise, false.

SetUnderline(string, Color?)

Sets the underline color, if any, to be associated with the given key. If the key is already assigned a color, it will not overwrite the existing color.

public bool SetUnderline(string key, Color? color)
Parameter Type Description
key string

The key, which is typically matches an IClassificationType key.

color Color?

The color to be assigned.

Returns

bool:

true if the color was added; otherwise, false.

SetUnderline(string, Color?, bool)

Sets the underline color, if any, to be associated with the given key.

public bool SetUnderline(string key, Color? color, bool overwriteExisting)
Parameter Type Description
key string

The key, which is typically matches an IClassificationType key.

color Color?

The color to be assigned.

overwriteExisting bool

true to overwrite any existing color already assigned for the same key; otherwise, false and the color will only be assigned if it is not currently assigned.

Returns

bool:

true if the color was added; otherwise, false.

Inherited Members