Class HtmlElement
Defines a html element
Implements
Inherited Members
Namespace: ImageVault.Common.Data.Display
Assembly: ImageVault.Common.dll
Syntax
public class HtmlElement : Node, ICloneable
Constructors
HtmlElement()
Initializes a new instance of the HtmlElement class.
Declaration
public HtmlElement()
HtmlElement(HtmlElement)
Initializes a new instance of the HtmlElement class.
Declaration
public HtmlElement(HtmlElement htmlElement)
Parameters
| Type | Name | Description |
|---|---|---|
| HtmlElement | htmlElement |
Fields
Attributes
the attributes of the element
Declaration
public Dictionary<string, AttributeValue> Attributes
Field Value
| Type | Description |
|---|---|
| System.Collections.Generic.Dictionary<System.String, AttributeValue> |
Properties
ChildNodes
Gets the ChildNodes of the HtmlElement
Declaration
public List<Node> ChildNodes { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<Node> |
ClosingMode
Get/Sets the ClosingMode of the HtmlElement
Declaration
public ElementCloseMode ClosingMode { get; set; }
Property Value
| Type | Description |
|---|---|
| ElementCloseMode |
SelfClosing
If the element should be self closing.
Declaration
[Obsolete("Use ClosingMode instead")]
public bool SelfClosing { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
SelfClosingAlternateSetting
Sets the SelfClosingAlternateSetting of the HtmlElement
Declaration
[Obsolete("Use ClosingMode instead")]
public bool SelfClosingAlternateSetting { set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | Only used to read legacy serialize info |
TagName
The tag name of the element
Declaration
public string TagName { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Methods
Bind(BindContext)
Binds the node according to the supplied context
Declaration
public override void Bind(BindContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| BindContext | context |
Overrides
Bind(Media)
Binds the Node to the supplied mediaItem
Declaration
[Obsolete("Use Bind(BindContext) instead")]
public override void Bind(Media info)
Parameters
| Type | Name | Description |
|---|---|---|
| Media | info |
Overrides
BindAttribute(String, AttributeBindName)
Binds a value to a attribute
Declaration
[Obsolete("Use BindContext.MapAttribute and Bind(BindContext) instead")]
public override void BindAttribute(string value, AttributeBindName bindValue)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | value | |
| AttributeBindName | bindValue |
Overrides
Clone()
Creates a new object that is a copy of the current instance.
Declaration
public override Node Clone()
Returns
| Type | Description |
|---|---|
| Node | A new object that is a copy of this instance. |
Overrides
EnsureAttribute(String, AttributeValue)
Ensures that the supplied attribute exists
Declaration
public void EnsureAttribute(string name, AttributeValue value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | name of the attribute |
| AttributeValue | value | Value of the attribute |
Remarks
If attribute exists, it remains unchanged. If it does not exist, it is added with the supplied value
EnsureAttribute(String, String)
Ensures that the supplied attribute exists.
Declaration
public void EnsureAttribute(string name, string defaultValue)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Name of the attribute |
| System.String | defaultValue | Value to add as default value if attribute is not present. |
GetBaseUrl(String)
Gets the media base url including trailing /
Declaration
[Obsolete("Use BindContext instead")]
protected string GetBaseUrl(string url)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | url |
Returns
| Type | Description |
|---|---|
| System.String |
ToString()
Makes a html string out of the element
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String | A System.String that represents the current HtmlElement. |
Overrides
UrlEncodeWhiteSpace(String)
Declaration
public static string UrlEncodeWhiteSpace(string s)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | s |
Returns
| Type | Description |
|---|---|
| System.String |