Example #1
0
 /// <summary>
 /// Creates a new HTML tag that encloses another HTML tag
 /// </summary>
 /// <param name="tagName">Name of this tag</param>
 /// <param name="enclosedTag">Tag that will enclodes by this tag. Means: <THISTAG><ENCLOSEDTAG></ENCLOSEDTAG></THISTAG>  </param>
 public WeakHTMLTag(string tagName, WeakHTMLTag enclosedTag)
     : this(tagName, WeakHTMLContentType.HTML, enclosedTag.ToString())
 {
     if (enclosedTag == null)
     {
         throw new ArgumentNullException();
     }
 }
Example #2
0
        /// <summary>
        /// Creates a clone of a existing WeakHTMLTag and encloses another WeakHTMLTag into it.
        /// </summary>
        /// <param name="outerTag">The WeakHTMLTag that used as the outer tag</param>
        /// <param name="enclosedTag">The WeakHTMLTag used as the inner (enclosed) tag</param>
        public WeakHTMLTag(WeakHTMLTag outerTag, WeakHTMLTag enclosedTag)
            : this(outerTag)
        {
            if (enclosedTag == null)
            {
                throw new ArgumentNullException();
            }

            //This element is now correctly set to the data in OuterTag
            //If this HTML tag does not have any value, we can use directly EnclosedTag as data
            if (string.IsNullOrWhiteSpace(this.HTML))
            {
                this.HTML = enclosedTag.ToString();
            }
            else
            {
                //This HTML tag has a value set, so combine those two
                this.HTML += enclosedTag.ToString();
            }
        }