Example #1
0
 internal Element(Document document, IElement root, TParent parrent, IHtmlSerializerFactory serializerFactory) :
     base(document, root, parrent, serializerFactory)
 {
     attributeSet = new TTag();
     name         = attributeSet.TagName;
     Parent       = (TParent)base.Parent;
 }
        public void SetUp()
        {
            var settings = new HtmlSerializerSettings();

            settings.AddAttributeValueTypeSerializer(new HtmlAttributeBoolTypePrinter());
            settings.AddAttributeSerializer(new HtmlAttributeUpCaseClassAttribute());

            serializerFactory = new HtmlSerializerFactory(settings);
            elementFactory    = new ElementFactory();
        }
Example #3
0
        public IElement <TAttributesSet, IElement> Create <TAttributesSet>(
            Expression <Func <ITagSet <IElement>, IElement <TAttributesSet, IElement> > > tagSelector,
            IHtmlSerializerFactory serializerFactory)
            where TAttributesSet : IGlobalElement, new()
        {
            Element <TAttributesSet, IElement> element = null;

            element = new Element <TAttributesSet, IElement>(null, element, null, serializerFactory);

            return(element);
        }
Example #4
0
        public Document(IHtmlSerializerFactory serializerFactory, string typeValue)
        {
            this.serializerFactory = serializerFactory;
            TypeValue = typeValue;
            var html = default(Element <Html, IElement>);

            html = new Element <Html, IElement>(this, html, null, serializerFactory);
            Html = html;
            Head = html.AddChild(x => x.Head);
            Body = html.AddChild(x => x.Body);
        }
Example #5
0
        public Document(IHtmlSerializerFactory serializerFactory, DocumentType documentType = DocumentType.Html5)
        {
            this.serializerFactory = serializerFactory;
            TypeValue = documentType.GetDescription();
            var html = default(Element <Html, IElement>);

            html = new Element <Html, IElement>(this, html, null, serializerFactory);
            Html = html;
            Head = html.AddChild(x => x.Head);
            Body = html.AddChild(x => x.Body);
        }
Example #6
0
 public void SetUp()
 {
     serializerFactory = new HtmlSerializerFactory();
     elementFactory    = new ElementFactory();
 }
Example #7
0
 private Element(Document document, IElement root, TParent parrent, TTag attributeSet, IHtmlSerializerFactory serializerFactory) :
     base(document, root, parrent, serializerFactory)
 {
     name   = attributeSet.TagName;
     Parent = (TParent)base.Parent;
 }