HtmlKit.HtmlTagToken.WriteTo C# (CSharp) Method

WriteTo() public method

Write the HTML tag to a System.IO.TextWriter.
Writes the HTML tag to a System.IO.TextWriter.
/// is null. ///
public WriteTo ( TextWriter output ) : void
output System.IO.TextWriter The output.
return void
		public override void WriteTo (TextWriter output)
		{
			if (output == null)
				throw new ArgumentNullException ("output");

			output.Write ('<');
			if (IsEndTag)
				output.Write ('/');
			output.Write (Name);
			for (int i = 0; i < Attributes.Count; i++) {
				output.Write (' ');
				output.Write (Attributes[i].Name);
				if (Attributes[i].Value != null) {
					output.Write ('=');
					HtmlUtils.HtmlAttributeEncode (output, Attributes[i].Value);
				}
			}
			if (IsEmptyElement)
				output.Write ('/');
			output.Write ('>');
		}
	}