Exemple #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();
 }
Exemple #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);
        }
Exemple #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();
 }