Class Tag
HTML Tag capabilities.
Inheritance
Namespace: Supremes.Nodes
Assembly: Supremes.dll
Syntax
public sealed class Tag : object
Properties
CanContainBlock
Gets if this tag can contain block tags.
Declaration
public bool CanContainBlock { get; }
Property Value
Type | Description |
---|---|
System.Boolean | if tag can contain block tags |
IsBlock
Gets if this is a block tag.
Declaration
public bool IsBlock { get; }
Property Value
Type | Description |
---|---|
System.Boolean | if block tag |
IsData
Gets if this tag is a data only tag.
Declaration
public bool IsData { get; }
Property Value
Type | Description |
---|---|
System.Boolean | if this tag is a data only tag |
IsEmpty
Get if this is an empty tag
Declaration
public bool IsEmpty { get; }
Property Value
Type | Description |
---|---|
System.Boolean | if this is an empty tag |
IsFormattedAsBlock
Gets if this tag should be formatted as a block (or as inline)
Declaration
public bool IsFormattedAsBlock { get; }
Property Value
Type | Description |
---|---|
System.Boolean | if should be formatted as block or inline |
IsFormListed
Get if this tag represents a control associated with a form.
Declaration
public bool IsFormListed { get; }
Property Value
Type | Description |
---|---|
System.Boolean | if associated with a form |
Remarks
E.g. input, textarea, output
IsFormSubmittable
Get if this tag represents an element that should be submitted with a form.
Declaration
public bool IsFormSubmittable { get; }
Property Value
Type | Description |
---|---|
System.Boolean | if submittable with a form |
Remarks
E.g. input, option
IsInline
Gets if this tag is an inline tag.
Declaration
public bool IsInline { get; }
Property Value
Type | Description |
---|---|
System.Boolean | if this tag is an inline tag. |
IsKnown
Get if this is a pre-defined tag, or was auto created on parsing.
Declaration
public bool IsKnown { get; }
Property Value
Type | Description |
---|---|
System.Boolean | if a known tag |
IsSelfClosing
Get if this tag is self closing.
Declaration
public bool IsSelfClosing { get; }
Property Value
Type | Description |
---|---|
System.Boolean | if this tag should be output as self closing. |
Name
Get this tag's name.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
System.String | the tag's name |
PreservesWhitespace
Get if this tag should preserve whitespace within child text nodes.
Declaration
public bool PreservesWhitespace { get; }
Property Value
Type | Description |
---|---|
System.Boolean | if preserve whitepace |
Methods
Equals(Object)
Compares two Tag instances for equality.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj |
Returns
Type | Description |
---|---|
System.Boolean |
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
IsKnownTag(String)
Check if this tagname is a known tag.
Declaration
public static bool IsKnownTag(string tagName)
Parameters
Type | Name | Description |
---|---|---|
System.String | tagName | name of tag |
Returns
Type | Description |
---|---|
System.Boolean | if known HTML tag |
ToString()
Converts the value of this instance to a string.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
ValueOf(String)
Get a Tag by name.
Declaration
public static Tag ValueOf(string tagName)
Parameters
Type | Name | Description |
---|---|---|
System.String | tagName | Name of tag, e.g. "p". Case insensitive. |
Returns
Type | Description |
---|---|
Tag | The tag, either defined or new generic. |
Remarks
If not previously defined (unknown), returns a new generic tag, that can do anything.
Pre-defined tags (P, DIV etc) will be ==, but unknown tags are not registered and will only .equals().