Esempio n. 1
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("writer");
			if (color == null)
				throw new ArgumentNullException("color");
			writer.Write(" style=\"");
			#if DOTNET4
			WebUtility.HtmlEncode(color.ToCss(), writer);
			#else
			HttpUtility.HtmlEncode(color.ToCss(), writer);
			#endif
			writer.Write('"');
		}
Esempio n. 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("writer");
			if (color == null)
				throw new ArgumentNullException("color");
			writer.Write(" style=\"");

			WebUtility.HtmlEncode(color.ToCss(), writer);
			#else
			HttpUtility.HtmlEncode(color.ToCss(), writer);

			writer.Write('"');
		}
Esempio n. 3
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("color");
     }
     return(!string.IsNullOrEmpty(color.ToCss()));
 }
Esempio n. 4
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("writer");
     }
     if (color == null)
     {
         throw new ArgumentNullException("color");
     }
     writer.Write(" style=\"");
     writer.Write(color.ToCss());
     writer.Write("\"");
 }
Esempio n. 5
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("writer");
     if (color == null)
         throw new ArgumentNullException("color");
     writer.Write(" style=\"");
     writer.Write(color.ToCss());
     writer.Write("\"");
 }
Esempio n. 6
0
			public override void WriteStyleAttributeForColor(TextWriter writer, HighlightingColor color)
			{
				htmlWriter.WriteStyle(writer, color.ToCss());
			}
Esempio n. 7
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());
 }