Beispiel #1
0
        public HtmlTagNode?Add(HtmlTag tag)
        {
            if (!CanAdd(tag))
            {
                throw new Exception();
            }

            var result = new HtmlTagNode(this, tag);

            _items.Add(result);

            return(tag.Name == '/' + Tag.Name
                ? Parent
                : result);
        }
Beispiel #2
0
 public HtmlTagNode(HtmlTagNode parent, HtmlTag tag)
     : this(false, tag)
 {
     Parent = parent ?? throw new ArgumentNullException(nameof(parent));
 }