Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HtmlElement"/> class.
 /// </summary>
 /// <param name="rawText"></param>
 internal HtmlElement(string rawText)
 {
     this.rawText    = rawText;
     this.hasRawText = true;
     this.attributes = new List <HtmlElementAttribute>();
     this.children   = new HtmlElementsCollection();
 }
Example #2
0
        /// <summary>
        /// Insert HTML element collection as children of caller element.
        /// </summary>
        /// <param name="elementsAction"></param>
        /// <returns></returns>
        public HtmlElement AppendMultiple(Action <HtmlElementsCollection> elementsAction)
        {
            var childElements = new HtmlElementsCollection();

            elementsAction.Invoke(childElements);
            this.children.AddRange(childElements);
            return(this);
        }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HtmlElement"/> class.
 /// </summary>
 /// <param name="tag"></param>
 internal HtmlElement(HtmlTag tag)
 {
     this.tag        = tag;
     this.attributes = new List <HtmlElementAttribute>();
     this.children   = new HtmlElementsCollection();
 }