示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MimeKit.Text.HtmlTagToken"/> class.
        /// </summary>
        /// <remarks>
        /// Creates a new <see cref="HtmlTagToken"/>.
        /// </remarks>
        /// <param name="name">The name of the tag.</param>
        /// <param name="isEndTag"><c>true</c> if the tag is an end tag; otherwise, <c>false</c>.</param>
        /// <exception cref="System.ArgumentNullException">
        /// <paramref name="name"/> is <c>null</c>.
        /// </exception>
        public HtmlTagToken(string name, bool isEndTag) : base(HtmlTokenKind.Tag)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }

            Attributes = new HtmlAttributeCollection();
            Id         = name.ToHtmlTagId();
            IsEndTag   = isEndTag;
            Name       = name;
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MimeKit.Text.HtmlTagToken"/> class.
        /// </summary>
        /// <remarks>
        /// Creates a new <see cref="HtmlTagToken"/>.
        /// </remarks>
        /// <param name="name">The name of the tag.</param>
        /// <param name="attributes">The attributes.</param>
        /// <param name="isEmptyElement"><c>true</c> if the tag is an empty element; otherwise, <c>false</c>.</param>
        /// <exception cref="System.ArgumentNullException">
        /// <para><paramref name="name"/> is <c>null</c>.</para>
        /// <para>-or-</para>
        /// <para><paramref name="attributes"/> is <c>null</c>.</para>
        /// </exception>
        public HtmlTagToken(string name, IEnumerable <HtmlAttribute> attributes, bool isEmptyElement) : base(HtmlTokenKind.Tag)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }

            if (attributes == null)
            {
                throw new ArgumentNullException("attributes");
            }

            Attributes     = new HtmlAttributeCollection(attributes);
            IsEmptyElement = isEmptyElement;
            Id             = name.ToHtmlTagId();
            Name           = name;
        }
示例#3
0
 public FlowedToHtmlTagContext(HtmlTagId tag) : base(tag)
 {
     attrs = HtmlAttributeCollection.Empty;
 }
示例#4
0
 public FlowedToHtmlTagContext(HtmlTagId tag, HtmlAttribute attr) : base(tag)
 {
     attrs = new HtmlAttributeCollection(new [] { attr });
 }