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 |
| background | Color? | The background Color of the highlighting style. The default value is |
| bold | bool? | A nullable bool indicating whether the highlighting style uses boldface. The default value is |
| italic | bool? | A nullable bool indicating whether the highlighting style uses italics. The default value is |
| 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 |
Properties
Background
The background color of the highlighting style, if any.
BackgroundSpansVirtualSpace
Indicates whether the background should span virtual space when the styled range includes a line terminator.
Bold
Indicates whether the highlighting style uses boldface.
BorderColor
The border color of the highlighting style, if any.
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.
FontFamilyName
The name of the font family to use for drawing text with the highlighting style, or null to use the default.
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
0to use a default value, which is the default property value.
Foreground
The foreground color of the highlighting style, if any.
HasBackground
Indicates whether the highlighting style has a background.
public bool HasBackground { get; }
Property Value
- bool:
trueif the highlighting style has a background; otherwise,false.
HasBorder
Indicates whether the highlighting style has a border.
public bool HasBorder { get; }
Property Value
- bool:
trueif 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:
trueif 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:
trueif 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:
trueif 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:
trueif 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:
trueif the Background property is editable in an options dialog; otherwise,false. The default value istrue.
IsBoldEditable
Indicates whether the Bold property is editable in an options dialog.
public bool IsBoldEditable { get; set; }
Property Value
IsBorderEditable
Indicates whether the BorderColor and related properties are editable in an options dialog.
public bool IsBorderEditable { get; set; }
Property Value
- bool:
trueif the BorderColor and related properties are editable in an options dialog; otherwise,false. The default value isfalse.
IsForegroundEditable
Indicates whether the Foreground property is editable in an options dialog.
public bool IsForegroundEditable { get; set; }
Property Value
- bool:
trueif the Foreground property is editable in an options dialog; otherwise,false. The default value istrue.
IsItalicEditable
Indicates whether the Italic property is editable in an options dialog.
public bool IsItalicEditable { get; set; }
Property Value
Italic
Indicates whether the highlighting style uses italics.
StrikethroughColor
The strike-through color of the highlighting style, if any.
StrikethroughKind
A LineKind indicating the kind of strike-through to use.
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.
UnderlineColor
The underline color of the highlighting style, if any.
UnderlineKind
A LineKind indicating the kind of underline to use.
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.
Inherited Members
- ObservableObjectBase.NotifyPropertyChanged(string)
- ObservableObjectBase.OnPropertyChanged(string)
- ObservableObjectBase.OnPropertyChanged(PropertyChangedEventArgs)
- ObservableObjectBase.OnPropertyChanging(string)
- ObservableObjectBase.OnPropertyChanging(PropertyChangingEventArgs)
- ObservableObjectBase.SetProperty<T>(ref T, T, string)
- ObservableObjectBase.PropertyChanged
- ObservableObjectBase.PropertyChanging
- object.GetType()
- object.MemberwiseClone()
- object.Equals(object)
- object.Equals(object, object)
- object.ReferenceEquals(object, object)
- object.GetHashCode()