Ejemplo n.º 1
0
 /// <summary>
 /// Converts <paramref name="self"/> to a <see cref="HighlightingColor"/> instance or null
 /// if input is null
 /// </summary>
 /// <param name="self">This</param>
 /// <returns></returns>
 public static HighlightingColor ToHighlightingColor(this IThemeColor self)
 {
     if (self == null)
         return null;
     var hl = new HighlightingColor {
         Name = self.Name,
         FontWeight = self.FontWeight,
         FontStyle = self.FontStyle,
         Underline = null,
         Foreground = MyHighlightingBrush.Create(self.Foreground),
         Background = MyHighlightingBrush.Create(self.Background),
     };
     hl.Freeze();
     return hl;
 }
Ejemplo n.º 2
0
 /// <inheritdoc/>
 public override void BeginSpan(Color foregroundColor)
 {
     BeginColorSpan();
     currentColor.Foreground = new SimpleHighlightingBrush(foregroundColor);
     currentColor.Freeze();
 }