|
|
|
@ -86,8 +86,8 @@ namespace ICSharpCode.AvalonEdit.Highlighting |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Gets/sets the underline flag. Null if the underline status does not change the font style.
|
|
|
|
/// Gets/sets the underline flag. Null if the underline status does not change the font style.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public bool? Underline { |
|
|
|
public bool? Underline { |
|
|
|
get { |
|
|
|
get { |
|
|
|
return underline; |
|
|
|
return underline; |
|
|
|
@ -97,7 +97,7 @@ namespace ICSharpCode.AvalonEdit.Highlighting |
|
|
|
throw new InvalidOperationException(); |
|
|
|
throw new InvalidOperationException(); |
|
|
|
underline = value; |
|
|
|
underline = value; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Gets/sets the foreground color applied by the highlighting.
|
|
|
|
/// Gets/sets the foreground color applied by the highlighting.
|
|
|
|
@ -146,6 +146,8 @@ namespace ICSharpCode.AvalonEdit.Highlighting |
|
|
|
this.FontWeight = System.Windows.FontWeight.FromOpenTypeWeight(info.GetInt32("Weight")); |
|
|
|
this.FontWeight = System.Windows.FontWeight.FromOpenTypeWeight(info.GetInt32("Weight")); |
|
|
|
if (info.GetBoolean("HasStyle")) |
|
|
|
if (info.GetBoolean("HasStyle")) |
|
|
|
this.FontStyle = (FontStyle?)new FontStyleConverter().ConvertFromInvariantString(info.GetString("Style")); |
|
|
|
this.FontStyle = (FontStyle?)new FontStyleConverter().ConvertFromInvariantString(info.GetString("Style")); |
|
|
|
|
|
|
|
if (info.GetBoolean("HasUnderline")) |
|
|
|
|
|
|
|
this.Underline = info.GetBoolean("Underline"); |
|
|
|
this.Foreground = (HighlightingBrush)info.GetValue("Foreground", typeof(HighlightingBrush)); |
|
|
|
this.Foreground = (HighlightingBrush)info.GetValue("Foreground", typeof(HighlightingBrush)); |
|
|
|
this.Background = (HighlightingBrush)info.GetValue("Background", typeof(HighlightingBrush)); |
|
|
|
this.Background = (HighlightingBrush)info.GetValue("Background", typeof(HighlightingBrush)); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -169,6 +171,9 @@ namespace ICSharpCode.AvalonEdit.Highlighting |
|
|
|
info.AddValue("HasStyle", this.FontStyle.HasValue); |
|
|
|
info.AddValue("HasStyle", this.FontStyle.HasValue); |
|
|
|
if (this.FontStyle.HasValue) |
|
|
|
if (this.FontStyle.HasValue) |
|
|
|
info.AddValue("Style", this.FontStyle.Value.ToString()); |
|
|
|
info.AddValue("Style", this.FontStyle.Value.ToString()); |
|
|
|
|
|
|
|
info.AddValue("HasUnderline", this.Underline.HasValue); |
|
|
|
|
|
|
|
if (this.Underline.HasValue) |
|
|
|
|
|
|
|
info.AddValue("Underline", this.Underline.Value); |
|
|
|
info.AddValue("Foreground", this.Foreground); |
|
|
|
info.AddValue("Foreground", this.Foreground); |
|
|
|
info.AddValue("Background", this.Background); |
|
|
|
info.AddValue("Background", this.Background); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -196,6 +201,12 @@ namespace ICSharpCode.AvalonEdit.Highlighting |
|
|
|
b.Append(FontStyle.Value.ToString().ToLowerInvariant()); |
|
|
|
b.Append(FontStyle.Value.ToString().ToLowerInvariant()); |
|
|
|
b.Append("; "); |
|
|
|
b.Append("; "); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (Underline != null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
b.Append("text-decoration: "); |
|
|
|
|
|
|
|
b.Append(Underline.Value ? "underline" : "none"); |
|
|
|
|
|
|
|
b.Append("; "); |
|
|
|
|
|
|
|
} |
|
|
|
return b.ToString(); |
|
|
|
return b.ToString(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -247,7 +258,9 @@ namespace ICSharpCode.AvalonEdit.Highlighting |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (other == null) |
|
|
|
if (other == null) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
return this.name == other.name && this.fontWeight == other.fontWeight && this.fontStyle == other.fontStyle && object.Equals(this.foreground, other.foreground) && object.Equals(this.background, other.background); |
|
|
|
return this.name == other.name && this.fontWeight == other.fontWeight |
|
|
|
|
|
|
|
&& this.fontStyle == other.fontStyle && this.underline == other.underline |
|
|
|
|
|
|
|
&& object.Equals(this.foreground, other.foreground) && object.Equals(this.background, other.background); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
/// <inheritdoc/>
|
|
|
|
@ -282,11 +295,14 @@ namespace ICSharpCode.AvalonEdit.Highlighting |
|
|
|
this.foreground = color.foreground; |
|
|
|
this.foreground = color.foreground; |
|
|
|
if (color.background != null) |
|
|
|
if (color.background != null) |
|
|
|
this.background = color.background; |
|
|
|
this.background = color.background; |
|
|
|
|
|
|
|
if (color.underline != null) |
|
|
|
|
|
|
|
this.underline = color.underline; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
internal bool IsEmptyForMerge { |
|
|
|
internal bool IsEmptyForMerge { |
|
|
|
get { |
|
|
|
get { |
|
|
|
return fontWeight == null && fontStyle == null && foreground == null && background == null; |
|
|
|
return fontWeight == null && fontStyle == null && underline == null |
|
|
|
|
|
|
|
&& foreground == null && background == null; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|