Beispiel #1
0
        public void Setup()
        {
            const bool req = true;

            _doc = new Document(
                new List <IDomPart> {
                new Tag("!DOCTYPE html"),
                new TWithContent(
                    new Tag("html"),
                    new TWithContent(
                        new TWithAttributes(
                            new Tag("head"),
                            new TAWithValue(
                                new TAttribute("lang"),
                                "ru_RU"
                                )
                            ).Attr(
                            req
                                    ? new TAttribute("required") as ITAttribute
                                    : new TAEmpty() as ITAttribute
                            ),
                        new Raw("test")
                        )
                    )
            }
                );
        }
Beispiel #2
0
 public IPartGroup Add(IDomPart part)
 {
     return(new PartsGroup(_parts.Add(part)));
 }
Beispiel #3
0
 public PartsGroup(IDomPart part)
     : this(new[] { part })
 {
 }
Beispiel #4
0
 public ITag Content(IDomPart content)
 {
     return(new TWithContent(_origin, content));
 }
Beispiel #5
0
 public TWithContent(ITag origin, IDomPart content)
 {
     _origin  = origin;
     _content = content;
 }
Beispiel #6
0
 public Tag(IDomPart tagPart)
     : this(new[] { tagPart })
 {
 }
Beispiel #7
0
 public IHtmlDocument AddToHead(IDomPart part)
 {
     return new DocHtml5(_head.Add(part), _body);
 }
Beispiel #8
0
 public IHtmlDocument AddToBody(IDomPart part)
 {
     return new DocHtml5(_head, _body.Add(part));
 }
Beispiel #9
0
 public IHtmlDocument WithPart(IDomPart part)
 {
     return AddToBody(part);
 }
Beispiel #10
0
 public DocHtml5(IDomPart head, IDomPart body)
     : this(new[] { head }, new[] { body })
 {
 }
Beispiel #11
0
 public Document WithPart(IDomPart part)
 {
     return(new Document(Parts().Add(part)));
 }
Beispiel #12
0
 public Document(IDomPart domPart)
     : this(new[] { domPart })
 {
 }