public static bool IsBaseTag(HtmlTagId tagId, HtmlTagContextAttribute attribute) { return(tagId == HtmlTagId.Base && attribute.Id == HtmlAttributeId.Href); }
public FlowedToHtmlTagContext (HtmlTagId tag, HtmlAttribute attr) : base (tag) { attrs = new HtmlAttributeCollection (new [] { attr }); }
protected static bool IsUrlTag(HtmlTagId tagId, HtmlTagContextAttribute attribute) { return((tagId == HtmlTagId.A && attribute.Id == HtmlAttributeId.Href) || (tagId == HtmlTagId.Area && attribute.Id == HtmlAttributeId.Href)); }
protected static bool IsImageTag(HtmlTagId tagId, HtmlTagContextAttribute attribute) { return((tagId == HtmlTagId.Img && attribute.Id == HtmlAttributeId.Src) || (tagId == HtmlTagId.Img && attribute.Id == HtmlAttributeId.DynSrc) || (tagId == HtmlTagId.Img && attribute.Id == HtmlAttributeId.LowSrc)); }
public TextToHtmlTagContext(HtmlTagId tag, HtmlAttribute attr) : base(tag) { attributes = new HtmlAttributeCollection(new [] { attr }); }
public TextToHtmlTagContext(HtmlTagId tag) : base(tag) { attributes = HtmlAttributeCollection.Empty; }
/// <summary> /// Write a start tag. /// </summary> /// <remarks> /// Writes a start tag. /// </remarks> /// <param name="id">The HTML tag identifier.</param> /// <exception cref="System.ArgumentException"> /// <paramref name="id"/> is not a valid HTML tag identifier. /// </exception> /// <exception cref="System.ObjectDisposedException"> /// The <see cref="HtmlWriter"/> has been disposed. /// </exception> public void WriteStartTag (HtmlTagId id) { if (id == HtmlTagId.Unknown) throw new ArgumentException ("Invalid tag.", "id"); CheckDisposed (); if (WriterState != HtmlWriterState.Default) { html.Write (empty ? "/>" : ">"); empty = false; } html.Write (string.Format ("<{0}", id.ToHtmlTagName ())); WriterState = HtmlWriterState.Tag; }
internal int FindEndTag(int from, HtmlTagId tagId) { return(FindEndTag(this.nodes, from, tagId)); }
protected static bool IsTargetTagInAnchor(HtmlTagId tagId, HtmlTagContextAttribute attr) { return((tagId == HtmlTagId.A && attr.Id == HtmlAttributeId.Target) || (tagId == HtmlTagId.Area && attr.Id == HtmlAttributeId.Target)); }
protected static bool IsFormElementTag(HtmlTagId tagId) { return(tagId == HtmlTagId.Input || tagId == HtmlTagId.Button || tagId == HtmlTagId.Select || tagId == HtmlTagId.OptGroup || tagId == HtmlTagId.Option || tagId == HtmlTagId.FieldSet || tagId == HtmlTagId.TextArea || tagId == HtmlTagId.IsIndex || tagId == HtmlTagId.Label || tagId == HtmlTagId.Legend); }
public bool IsEndTag(HtmlTagId id) { return(NodeType == HtmlNodeType.EndTag && TagId == id); }
public bool IsStartTag(HtmlTagId id) { return(NodeType == HtmlNodeType.Element && TagId == id); }
/// <summary> /// Initializes a new instance of the <see cref="MimeKit.Text.HtmlTagContext"/> class. /// </summary> /// <remarks> /// Creates a new <see cref="HtmlTagContext"/>. /// </remarks> /// <param name="tagId">The HTML tag identifier.</param> /// <exception cref="System.ArgumentOutOfRangeException"> /// <paramref name="tagId"/> is invalid. /// </exception> protected HtmlTagContext (HtmlTagId tagId) { TagId = tagId; }
public FlowedToHtmlTagContext (HtmlTagId tag) : base (tag) { attrs = HtmlAttributeCollection.Empty; }
public HtmlTagContext(HtmlTagId id) { TagId = id; }
/// <summary> /// Initializes a new instance of the <see cref="MimeKit.Text.HtmlTagContext"/> class. /// </summary> /// <remarks> /// Creates a new <see cref="HtmlTagContext"/>. /// </remarks> /// <param name="tagId">The HTML tag identifier.</param> /// <exception cref="System.ArgumentOutOfRangeException"> /// <paramref name="tagId"/> is invalid. /// </exception> protected HtmlTagContext(HtmlTagId tagId) { TagId = tagId; }
/// <summary> /// Converts the enum value into the equivalent tag name. /// </summary> /// <remarks> /// Converts the enum value into the equivalent tag name. /// </remarks> /// <returns>The tag name.</returns> /// <param name="value">The enum value.</param> public static string ToHtmlTagName(this HtmlTagId value) { return(tagsToNames[value]); }