void EmitTagAttribute () { attribute = CreateAttribute (name.ToString ()); tag.Attributes.Add (attribute); name.Length = 0; }
/// <summary> /// Write the attribute to the output stream. /// </summary> /// <remarks> /// Writes the attribute to the output stream. /// </remarks> /// <example> /// <code language="c#" source="Examples\MimeVisitorExamples.cs" region="HtmlPreviewVisitor" /> /// </example> /// <param name="attribute">The attribute.</param> /// <exception cref="System.ArgumentNullException"> /// <paramref name="attribute"/> is <c>null</c>. /// </exception> /// <exception cref="System.InvalidOperationException"> /// The <see cref="HtmlWriter"/> is not in a state that allows writing attributes. /// </exception> /// <exception cref="System.ObjectDisposedException"> /// The <see cref="HtmlWriter"/> has been disposed. /// </exception> public void WriteAttribute (HtmlAttribute attribute) { if (attribute == null) throw new ArgumentNullException ("attribute"); EncodeAttributeName (attribute.Name); if (attribute.Value != null) EncodeAttributeValue (attribute.Value); }
public FlowedToHtmlTagContext (HtmlTagId tag, HtmlAttribute attr) : base (tag) { attrs = new HtmlAttributeCollection (new [] { attr }); }
public TextToHtmlTagContext(HtmlTagId tag, HtmlAttribute attr) : base(tag) { attributes = new HtmlAttributeCollection(new [] { attr }); }