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)

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

protected 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>

Exceptions

Type Condition
ArgumentNullException

Name

The name of the color palette.

public string Name { get; }

Property Value

string

Exceptions

Type Condition
ArgumentNullException

Methods

ClearAll()

Clears all colors defined in the color palette.

public void ClearAll()

Exceptions

Type Condition
ArgumentNullException

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.

Exceptions

Type Condition
ArgumentNullException

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.

Exceptions

Type Condition
ArgumentNullException

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.

Exceptions

Type Condition
ArgumentNullException

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.

Exceptions

Type Condition
ArgumentNullException

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.

Exceptions

Type Condition
ArgumentNullException

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.

Exceptions

Type Condition
ArgumentNullException

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.

Exceptions

Type Condition
ArgumentNullException

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.

Exceptions

Type Condition
ArgumentNullException

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.

Exceptions

Type Condition
ArgumentNullException

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.

Exceptions

Type Condition
ArgumentNullException

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.

Exceptions

Type Condition
ArgumentNullException

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.

Exceptions

Type Condition
ArgumentNullException

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.

Exceptions

Type Condition
ArgumentNullException

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.

Exceptions

Type Condition
ArgumentNullException

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.

Exceptions

Type Condition
ArgumentNullException

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.

Exceptions

Type Condition
ArgumentNullException

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.

Exceptions

Type Condition
ArgumentNullException

Inherited Members

Extension Methods