BaseTagImpl<T> Class

Abstraction of Tag and EmptyTag.

C#
public abstract class BaseTagImpl<T> : AbstractNode, BaseTag<T>
where T : BaseTag<T>

Type Parameters

T
BaseTag<T>

The type of an HTML element.

Inheritance
BaseTagImpl<T>
Implements

Properties

Name
Kind (Inherited from AbstractNode)

Methods

AddAttributes((string Name, string Value)[])

Description copied from interface: BaseTag

Gets a new BaseTag<T> object with the specified attribute that has the specified value.

AddClass(string[])

Description copied from interface: BaseTag

Gets a new BaseTag<T> object with the class attribute that has both the values of this object and the specified values.

AddEmptyAttributes(string[])

Description copied from interface: BaseTag

Gets a new BaseTag<T> object with the specified empty attribute.

WithClass(string[])

Description copied from interface: BaseTag

Gets a new BaseTag<T> object with the class attribute that has the specified values.

WithId(string)

Description copied from interface: BaseTag

Gets a new BaseTag<T> object with the id attribute that has the specified value.

Create(Func<TagStruct, TagStruct>)

Gets a new element with the modifying function.

CreateAddingAttributes(IEnumerable<(string Name, string Value)>)

Gets a new element with adding the specified attributes.

Accept(NodeVisitor)

Description copied from interface: Node

Returns the object associated this node that is created with the specified visitor.

(Inherited from AbstractNode)
ToString() (Inherited from AbstractNode)
ToString(FormatOptions)

Description copied from interface: Node

Returns the string representing the current object, formatting it with the spcified FormatOptions.

(Inherited from AbstractNode)
GetKind()

Gets the kind of this node.

(Inherited from AbstractNode)
Equals(object) (Inherited from object)
GetHashCode() (Inherited from object)
GetType() (Inherited from object)
MemberwiseClone() (Inherited from object)

Properties Detail

Name

C#
public abstract string Name { get; }

Property Value

Implements

Methods Detail

AddAttributes((string Name, string Value)[])

Description copied from interface: BaseTag

Gets a new BaseTag<T> object with the specified attribute that has the specified value.

C#
public T AddAttributes(params (string Name, string Value)[] attributes)

Parameters

Returns

T

Description copied from interface: BaseTag

The new BaseTag<T> object.

Implements

AddClass(string[])

Description copied from interface: BaseTag

Gets a new BaseTag<T> object with the class attribute that has both the values of this object and the specified values.

C#
public T AddClass(params string[] values)

Parameters

values
string[]

Returns

T

Description copied from interface: BaseTag

The new BaseTag<T> object.

Implements

AddEmptyAttributes(string[])

Description copied from interface: BaseTag

Gets a new BaseTag<T> object with the specified empty attribute.

C#
public T AddEmptyAttributes(params string[] attributeNames)

Parameters

attributeNames
string[]

Returns

T

Description copied from interface: BaseTag

The new BaseTag<T> object.

Implements

Remarks

Description copied from interface: BaseTag

An invocation of this method of the form tag.AddEmptyAttributes(n1, n2) behaves in exactly the same way as the invocation tag.AddAttributes((n1, null), (n2, null)).

The web browser interprets the value of the empty attribute as the empty string implicitly. So, for example, <input disabled> is equivalent to <input disabled="">. The former can be generated with AddEmptyAttributes("disabled") or AddAttributes(("disabled", null)), and the latter with AddAttributes(("disabled", "")).

WithClass(string[])

Description copied from interface: BaseTag

Gets a new BaseTag<T> object with the class attribute that has the specified values.

C#
public T WithClass(params string[] values)

Parameters

values
string[]

Returns

T

Description copied from interface: BaseTag

The new BaseTag<T> object.

Implements

WithId(string)

Description copied from interface: BaseTag

Gets a new BaseTag<T> object with the id attribute that has the specified value.

C#
public T WithId(string id)

Parameters

id
string

Returns

T

Description copied from interface: BaseTag

The new BaseTag<T> object.

Implements

Create(Func<TagStruct, TagStruct>)

Gets a new element with the modifying function.

C#
protected abstract T Create(Func<TagStruct, TagStruct> modify)

Parameters

modify
Func<TagStruct, TagStruct>

The function that takes the data and returns the modified data.

Returns

T

A new element.

CreateAddingAttributes(IEnumerable<(string Name, string Value)>)

Gets a new element with adding the specified attributes.

C#
protected abstract T CreateAddingAttributes(IEnumerable<(string Name, string Value)> attributes)

Parameters

attributes
IEnumerable<(string Name, string Value)>

Tuples of the name and value representing an attribute. If the value of the tuple is null, it represents the empty attribute.

Returns

T

A new element.