-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding support for tags: h1, h2, h3, h4, h5, h6, p.
- Loading branch information
Showing
23 changed files
with
256 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System.ComponentModel; | ||
|
||
namespace EasyHtmlToolkit.Enums | ||
{ | ||
public enum ETag | ||
{ | ||
[Description("script")] | ||
script = 0, | ||
|
||
[Description("style")] | ||
style = 1, | ||
|
||
[Description("head")] | ||
head = 2, | ||
|
||
[Description("body")] | ||
body = 3, | ||
|
||
[Description("h1")] | ||
h1 = 4, | ||
|
||
[Description("h2")] | ||
h2 = 5, | ||
|
||
[Description("h3")] | ||
h3 = 6, | ||
|
||
[Description("h4")] | ||
h4 = 7, | ||
|
||
[Description("h5")] | ||
h5 = 8, | ||
|
||
[Description("h6")] | ||
h6 = 9, | ||
|
||
[Description("p")] | ||
p = 10, | ||
|
||
[Description("button")] | ||
button = 11, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using EasyHtmlToolkit.Enums; | ||
|
||
namespace EasyHtmlToolkit.Models.Elements | ||
{ | ||
/// <summary> | ||
/// This is h1 tag. | ||
/// </summary> | ||
public class H1Tag : HtmlElement | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public H1Tag() : base(ETag.h1) { } | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <param name="value"></param> | ||
public H1Tag(string value) : base(ETag.h1) | ||
{ | ||
InnerText = value; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using EasyHtmlToolkit.Enums; | ||
|
||
namespace EasyHtmlToolkit.Models.Elements | ||
{ | ||
public class H2Tag : HtmlElement | ||
{ | ||
public H2Tag() : base(ETag.h2) { } | ||
|
||
public H2Tag(string value) : base(ETag.h2) | ||
{ | ||
InnerText = value; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using EasyHtmlToolkit.Enums; | ||
|
||
namespace EasyHtmlToolkit.Models.Elements | ||
{ | ||
public class H3Tag : HtmlElement | ||
{ | ||
public H3Tag() : base(ETag.h3) { } | ||
|
||
public H3Tag(string value) : base(ETag.h3) | ||
{ | ||
InnerText = value; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using EasyHtmlToolkit.Enums; | ||
|
||
namespace EasyHtmlToolkit.Models.Elements | ||
{ | ||
public class H4Tag : HtmlElement | ||
{ | ||
public H4Tag() : base(ETag.h4) { } | ||
|
||
public H4Tag(string value) : base(ETag.h4) | ||
{ | ||
InnerText = value; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using EasyHtmlToolkit.Enums; | ||
|
||
namespace EasyHtmlToolkit.Models.Elements | ||
{ | ||
public class H5Tag : HtmlElement | ||
{ | ||
public H5Tag() : base(ETag.h5) { } | ||
|
||
public H5Tag(string value) : base(ETag.h5) | ||
{ | ||
InnerText = value; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using EasyHtmlToolkit.Enums; | ||
|
||
namespace EasyHtmlToolkit.Models.Elements | ||
{ | ||
public class H6Tag : HtmlElement | ||
{ | ||
public H6Tag() : base(ETag.h6) { } | ||
|
||
public H6Tag(string value) : base(ETag.h6) | ||
{ | ||
InnerText = value; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
namespace EasyHtmlToolkit.Models.Elements | ||
using EasyHtmlToolkit.Enums; | ||
|
||
namespace EasyHtmlToolkit.Models.Elements | ||
{ | ||
public class HtmlCell : HtmlElement | ||
{ | ||
public HtmlCell() : base("td") { } | ||
public HtmlCell() : base(ETag.h1) { } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
namespace EasyHtmlToolkit.Models.Elements | ||
using EasyHtmlToolkit.Enums; | ||
|
||
namespace EasyHtmlToolkit.Models.Elements | ||
{ | ||
public class HtmlDiv : HtmlElement | ||
{ | ||
public HtmlDiv() : base("div") { } | ||
public HtmlDiv() : base(ETag.h1) { } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
namespace EasyHtmlToolkit.Models.Elements | ||
using EasyHtmlToolkit.Enums; | ||
|
||
namespace EasyHtmlToolkit.Models.Elements | ||
{ | ||
public class HtmlRow : HtmlElement | ||
{ | ||
public HtmlRow() : base("tr") { } | ||
public HtmlRow() : base(ETag.h1) { } | ||
|
||
public void AddCell(HtmlCell cell) | ||
{ | ||
AddChild(cell); | ||
AddChildren(cell); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
namespace EasyHtmlToolkit.Models.Elements | ||
using EasyHtmlToolkit.Enums; | ||
|
||
namespace EasyHtmlToolkit.Models.Elements | ||
{ | ||
public class HtmlSpan : HtmlElement | ||
{ | ||
public HtmlSpan() : base("span") { } | ||
public HtmlSpan() : base(ETag.h1) { } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using EasyHtmlToolkit.Enums; | ||
|
||
namespace EasyHtmlToolkit.Models.Elements | ||
{ | ||
public class PTag : HtmlElement | ||
{ | ||
public PTag(string value) : base(ETag.p) | ||
{ | ||
InnerText = value; | ||
} | ||
} | ||
} |
Oops, something went wrong.