示例#1
0
 /// <summary>
 /// Gets whether the color needs to be written out to HTML.
 /// </summary>
 public virtual bool ColorNeedsSpanForStyling(HighlightingColor color)
 {
     if (color == null)
     {
         throw new ArgumentNullException(nameof(color));
     }
     return(!string.IsNullOrEmpty(color.ToCss()));
 }
示例#2
0
 /// <summary>
 /// Writes the HTML attribute for the style to the text writer.
 /// </summary>
 public virtual void WriteStyleAttributeForColor(TextWriter writer, HighlightingColor color)
 {
     if (writer == null)
     {
         throw new ArgumentNullException(nameof(writer));
     }
     if (color == null)
     {
         throw new ArgumentNullException(nameof(color));
     }
     writer.Write(" style=\"");
     writer.Write(WebUtility.HtmlEncode(color.ToCss()));
     writer.Write('"');
 }