Example #1
0
        public override void AddTag(Tag child)
        {
            var childTagType = child.GetTagType();

            if (childTagType == TagType.head ||
                childTagType == TagType.body)
            {
                Children.Add(child);
                child.SetFather(this);
            }
            else
            {
                throw new Exception("Invalid tag: " + childTagType + " with: " + Type);
            }
        }
        public override void AddTag(Tag child)
        {
            var childTagType = child.GetTagType();

            if (childTagType != TagType.head &&
                childTagType != TagType.body &&
                childTagType != TagType.html)
            {
                Children.Add(child);
                child.SetFather(this);
            }
            else
            {
                throw new Exception("Invalid tag ");
            }
        }
Example #3
0
        public override void AddTag(Tag child)
        {
            var childTagType = child.GetTagType();

            try
            {
                if (childTagType != TagType.head &&
                    childTagType != TagType.body &&
                    childTagType != TagType.html &&
                    childTagType != TagType.title)
                {
                    Children.Add(child);
                    child.SetFather(this);
                }
            }
            catch (Exception)
            {
                throw new Exception("Invalid tag ");
            }
        }