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()
Initializes the HighlightingStyle
class.
public HighlightingStyle()
HighlightingStyle(Color?)
Initializes the HighlightingStyle
class.
public HighlightingStyle(Color? foreground)
Parameter | Type | Description |
---|---|---|
foreground | Color? | The foreground Color of the highlighting style. |
HighlightingStyle(Color?, Color?)
Initializes the HighlightingStyle
class.
public HighlightingStyle(Color? foreground, Color? background)
Parameter | Type | Description |
---|---|---|
foreground | Color? | The foreground Color of the highlighting style. |
background | Color? | The background Color of the highlighting style. |
HighlightingStyle(Color?, Color?, bool?, bool?, LineKind)
Initializes the HighlightingStyle
class.
public HighlightingStyle(Color? foreground, Color? background, bool? bold, bool? italic, LineKind underlineKind)
Parameter | Type | Description |
---|---|---|
foreground | Color? | The foreground Color of the highlighting style. |
background | Color? | The background Color of the highlighting style. |
bold | bool? | A nullable bool indicating whether the highlighting style uses boldface. |
italic | bool? | A nullable bool indicating whether the highlighting style uses italics. |
underlineKind | LineKind | A LineKind indicating the underline kind. |
HighlightingStyle(Color?, Color?, bool?, bool?, LineKind, bool)
Initializes the HighlightingStyle
class.
public HighlightingStyle(Color? foreground, Color? background, bool? bold, bool? italic, LineKind underlineKind, bool backgroundSpansVirtualSpace)
Parameter | Type | Description |
---|---|---|
foreground | Color? | The foreground Color of the highlighting style. |
background | Color? | The background Color of the highlighting style. |
bold | bool? | A nullable bool indicating whether the highlighting style uses boldface. |
italic | bool? | A nullable bool indicating whether the highlighting style uses italics. |
underlineKind | LineKind | A LineKind indicating the underline kind. |
backgroundSpansVirtualSpace | bool | Whether the background should span virtual space when the styled range includes a line terminator. |
Properties
Background
Gets or sets the background color of the highlighting style.
public Color? Background { get; set; }
Property Value
BackgroundSpansVirtualSpace
Gets or sets a bool indicating whether the background should span virtual space when the styled range includes a line terminator.
public bool BackgroundSpansVirtualSpace { get; set; }
Property Value
Bold
Gets or sets a nullable bool indicating whether the highlighting style uses boldface.
public bool? Bold { get; set; }
Property Value
BorderColor
Gets or sets the border color of the highlighting style.
public Color? BorderColor { get; set; }
Property Value
BorderCornerKind
Gets or sets a HighlightingStyleBorderCornerKind indicating the kind of border corners.
public HighlightingStyleBorderCornerKind BorderCornerKind { get; set; }
Property Value
- HighlightingStyleBorderCornerKind:
A HighlightingStyleBorderCornerKind indicating the kind of border corners. The default value is
Square
.
BorderKind
Gets or sets a LineKind indicating the kind of border to use.
public LineKind BorderKind { get; set; }
Property Value
FontFamilyName
Gets or sets the name of the font family to use for drawing text with the highlighting style.
public string FontFamilyName { get; set; }
Property Value
- string:
The name of the font family to use for drawing text with the highlighting style.
FontSize
Gets or sets 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:
The size of the font to use for drawing text with the highlighting style. Specify
0
to use a default value, which is the default property value.
Foreground
Gets or sets the foreground color of the highlighting style.
public Color? Foreground { get; set; }
Property Value
HasBackground
Gets 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
Gets 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
Gets 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
Gets 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
Gets 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
Gets 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
Gets 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 istrue
.
IsBoldEditable
Gets whether the Bold property is editable in an options dialog.
public bool IsBoldEditable { get; set; }
Property Value
IsBorderEditable
Gets 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 isfalse
.
IsForegroundEditable
Gets 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 istrue
.
IsItalicEditable
Gets whether the Italic property is editable in an options dialog.
public bool IsItalicEditable { get; set; }
Property Value
Italic
Gets or sets a nullable bool indicating whether the highlighting style uses italics.
public bool? Italic { get; set; }
Property Value
StrikethroughColor
Gets or sets the strike-through color of the highlighting style.
public Color? StrikethroughColor { get; set; }
Property Value
StrikethroughKind
Gets or sets a LineKind indicating the kind of strike-through to use.
public LineKind StrikethroughKind { get; set; }
Property Value
StrikethroughWeight
Gets or sets a TextLineWeight indicating the strike-through line weight to use.
public TextLineWeight StrikethroughWeight { get; set; }
Property Value
- TextLineWeight:
A TextLineWeight indicating the strike-through line weight to use. The default value is
Single
.
Tag
Gets or sets the object that contains user-defined data about the object.
public object Tag { get; set; }
Property Value
Remarks
Any type derived from the object class can be assigned to this property.
UnderlineColor
Gets or sets the underline color of the highlighting style.
public Color? UnderlineColor { get; set; }
Property Value
UnderlineKind
Gets or sets a LineKind indicating the kind of underline to use.
public LineKind UnderlineKind { get; set; }
Property Value
UnderlineWeight
Gets or sets a TextLineWeight indicating the underlining line weight to use.
public TextLineWeight UnderlineWeight { get; set; }
Property Value
- TextLineWeight:
A TextLineWeight indicating the underlining line weight to use. The default value is
Single
.
Methods
ToString()
Returns a String
that represents the current Object
.
Inherited Members
- ObservableObjectBase.NotifyPropertyChanged(string)
- ObservableObjectBase.OnPropertyChanged(PropertyChangedEventArgs)
- ObservableObjectBase.SetProperty<T>(ref T, T, string)
- ObservableObjectBase.PropertyChanged
- object.GetType()
- object.MemberwiseClone()
- object.Equals(object)
- object.Equals(object, object)
- object.ReferenceEquals(object, object)
- object.GetHashCode()