In This Article

HighlightingStyle Class

A highlighting style that is applied to a span of text.

public class HighlightingStyle : ObservableObjectBase, IHighlightingStyle
Inheritance:
object ObservableObjectBase object
Implements:
IHighlightingStyle

Constructors

HighlightingStyle(Color?, Color?, bool?, bool?, LineKind, bool)

Initializes an instance of the class.

public HighlightingStyle(Color? foreground = null, Color? background = null, bool? bold = null, bool? italic = null, LineKind underlineKind = LineKind.None, bool backgroundSpansVirtualSpace = false)
Parameter Type Description
foreground Color?

The foreground Color of the highlighting style. The default value is null.

background Color?

The background Color of the highlighting style. The default value is null.

bold bool?

A nullable bool indicating whether the highlighting style uses boldface. The default value is null.

italic bool?

A nullable bool indicating whether the highlighting style uses italics. The default value is null.

underlineKind LineKind

A LineKind indicating the underline kind. The default value is None.

backgroundSpansVirtualSpace bool

Whether the background should span virtual space when the styled range includes a line terminator. The default value is false.

Properties

Background

The background color of the highlighting style, if any.

public Color? Background { get; set; }

Property Value

Color?

BackgroundSpansVirtualSpace

Indicates whether the background should span virtual space when the styled range includes a line terminator.

public bool BackgroundSpansVirtualSpace { get; set; }

Property Value

bool

Bold

Indicates whether the highlighting style uses boldface.

public bool? Bold { get; set; }

Property Value

bool?

BorderColor

The border color of the highlighting style, if any.

public Color? BorderColor { get; set; }

Property Value

Color?

BorderCornerKind

A HighlightingStyleBorderCornerKind value indicating the kind of border corners.

public HighlightingStyleBorderCornerKind BorderCornerKind { get; set; }

Property Value

HighlightingStyleBorderCornerKind:

The default value is Square.

BorderKind

A LineKind indicating the kind of border to use.

public LineKind BorderKind { get; set; }

Property Value

LineKind:

The default value is None.

FontFamilyName

The name of the font family to use for drawing text with the highlighting style, or null to use the default.

public string? FontFamilyName { get; set; }

Property Value

string

FontSize

The size of the font to use for drawing text with the highlighting style.

[TypeConverter(typeof(FontSizeConverter))]
public float FontSize { get; set; }

Property Value

float:

Specify 0 to use a default value, which is the default property value.

Foreground

The foreground color of the highlighting style, if any.

public Color? Foreground { get; set; }

Property Value

Color?

HasBackground

Indicates whether the highlighting style has a background.

public bool HasBackground { get; }

Property Value

bool:

true if the highlighting style has a background; otherwise, false.

HasBorder

Indicates whether the highlighting style has a border.

public bool HasBorder { get; }

Property Value

bool:

true if the highlighting style has a border; otherwise, false.

HasDefaultFormatting

Indicates whether the highlighting style contains all default values for formatting properties.

public bool HasDefaultFormatting { get; }

Property Value

bool:

true if the highlighting style contains all default values for formatting properties; otherwise, false.

HasFontChange

Indicates whether the highlighting style contains a font-related change.

public bool HasFontChange { get; }

Property Value

bool:

true if the highlighting style contains a font-related change; otherwise, false.

HasStrikethrough

Indicates whether the highlighting style has a strike-through.

public bool HasStrikethrough { get; }

Property Value

bool:

true if the highlighting style has a strike-through; otherwise, false.

HasUnderline

Indicates whether the highlighting style has an underline.

public bool HasUnderline { get; }

Property Value

bool:

true if the highlighting style has an underline; otherwise, false.

IsBackgroundEditable

Indicates whether the Background property is editable in an options dialog.

public bool IsBackgroundEditable { get; set; }

Property Value

bool:

true if the Background property is editable in an options dialog; otherwise, false. The default value is true.

IsBoldEditable

Indicates whether the Bold property is editable in an options dialog.

public bool IsBoldEditable { get; set; }

Property Value

bool:

true if the Bold property is editable in an options dialog; otherwise, false. The default value is true.

IsBorderEditable

Indicates whether the BorderColor and related properties are editable in an options dialog.

public bool IsBorderEditable { get; set; }

Property Value

bool:

true if the BorderColor and related properties are editable in an options dialog; otherwise, false. The default value is false.

IsForegroundEditable

Indicates whether the Foreground property is editable in an options dialog.

public bool IsForegroundEditable { get; set; }

Property Value

bool:

true if the Foreground property is editable in an options dialog; otherwise, false. The default value is true.

IsItalicEditable

Indicates whether the Italic property is editable in an options dialog.

public bool IsItalicEditable { get; set; }

Property Value

bool:

true if the Italic property is editable in an options dialog; otherwise, false. The default value is true.

Italic

Indicates whether the highlighting style uses italics.

public bool? Italic { get; set; }

Property Value

bool?

StrikethroughColor

The strike-through color of the highlighting style, if any.

public Color? StrikethroughColor { get; set; }

Property Value

Color?

StrikethroughKind

A LineKind indicating the kind of strike-through to use.

public LineKind StrikethroughKind { get; set; }

Property Value

LineKind:

The default value is None.

StrikethroughWeight

A TextLineWeight indicating the strike-through line weight to use.

public TextLineWeight StrikethroughWeight { get; set; }

Property Value

TextLineWeight:

The default value is Single.

Tag

The object that contains user-defined data about the object, if any.

public object? Tag { get; set; }

Property Value

object

UnderlineColor

The underline color of the highlighting style, if any.

public Color? UnderlineColor { get; set; }

Property Value

Color?

UnderlineKind

A LineKind indicating the kind of underline to use.

public LineKind UnderlineKind { get; set; }

Property Value

LineKind:

The default value is None.

UnderlineWeight

A TextLineWeight indicating the underlining line weight to use.

public TextLineWeight UnderlineWeight { get; set; }

Property Value

TextLineWeight:

The default value is Single.

Methods

ToString()

Returns the string representation of this object.

public override string ToString()

Returns

string:

The string representation of this object.

Inherited Members

Extension Methods