HtmlForgeX

API Reference

Class

HtmlTag

Namespace HtmlForgeX.Email
Assembly HtmlForgeX.Email
Base Element
Implements

Represents a generic HTML tag that can contain attributes and child elements.

Inheritance

Constructors

HtmlTag 4 overloads
public HtmlTag(String tag) #

Initializes a new instance of the HtmlTag class with the specified tag name.

Parameters

tag System.String requiredposition: 0
The name of the tag.
public HtmlTag(String tag, TagMode tagMode) #

Initializes a new instance of the HtmlTag class with a value contained within the tag.

Parameters

tag System.String requiredposition: 0
The name of the tag.
value System.String requiredposition: 1
The inner value for the tag.
HtmlTag(System.String tag, HtmlForgeX.Email.TagMode tagMode) #

Initializes a new instance of the HtmlTag class with the specified tag mode.

Parameters

tag System.String required
The name of the tag.
tagMode HtmlForgeX.Email.TagMode required
The TagMode indicating how the tag should be rendered.
public HtmlTag(String tag, String value, Dictionary<String, Object> attributes = null, TagMode tagMode = Normal) #

Initializes a new instance of the HtmlTag class with a value, attributes and tag mode.

Parameters

tag System.String requiredposition: 0
The name of the tag.
value System.String requiredposition: 1
The inner value for the tag.
attributes System.Collections.Generic.Dictionary{System.String,System.Object} = null optionalposition: 2
Optional attributes to apply.
tagMode HtmlForgeX.Email.TagMode = Normal optionalposition: 3
The TagMode indicating how the tag should be rendered.

Methods

public HtmlTag AddAttribute(String name, Object value) #
Returns: HtmlTag

Adds an attribute to the tag.

Parameters

name System.String requiredposition: 0
The attribute name.
value System.Object requiredposition: 1
The attribute value.

Returns

The HtmlTag object, allowing for method chaining.

public HtmlTag AddChild(Object child) #
Returns: HtmlTag

Adds a child element to the tag.

Parameters

child System.Object requiredposition: 0
The child to add.

Returns

The HtmlTag object, allowing for method chaining.

public override String ToString() #
Returns: String

Returns the HTML representation of this tag.

Properties

public Dictionary<String, Object> Attributes { get; set; } #

Gets the collection of attributes applied to this tag.