Class HtmlTagWriter
Inheritance
System.Object
HtmlTagWriter
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: ImageVault.Common.Html
Assembly: ImageVault.Common.dll
Syntax
public class HtmlTagWriter : IHtmlWriter
Constructors
HtmlTagWriter(String, HtmlClosingTag)
Declaration
public HtmlTagWriter(string tagName, HtmlClosingTag closingTag = HtmlClosingTag.End)
Parameters
Type | Name | Description |
---|---|---|
System.String | tagName | |
HtmlClosingTag | closingTag |
Methods
AddAttribute(String)
Adds a boolean attribute with no value set
Declaration
[Obsolete("Use SetAttribute instead")]
public void AddAttribute(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
AddAttribute(String, String)
Declaration
[Obsolete("Use SetAttribute instead")]
public void AddAttribute(string name, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | |
System.String | value |
AddIfExists(String, String)
Adds the attribute if it's value exists in the supplied context
Declaration
[Obsolete("Use SetIfExists instead")]
public void AddIfExists(string attributeName, string attributeValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | attributeName | |
System.String | attributeValue |
AppendChild(String, HtmlClosingTag)
Appends a child to the writer
Declaration
public HtmlTagWriter AppendChild(string tagName, HtmlClosingTag closingTag = HtmlClosingTag.End)
Parameters
Type | Name | Description |
---|---|---|
System.String | tagName | |
HtmlClosingTag | closingTag |
Returns
Type | Description |
---|---|
HtmlTagWriter |
AppendText(String)
Declaration
public void AppendText(string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | text |
RemoveAttribute(String)
Removes the attribute with the supplied name
Declaration
public void RemoveAttribute(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
SetAttribute(String, Boolean)
Sets a boolean attribute
Declaration
public void SetAttribute(string attributeName, bool value)
Parameters
Type | Name | Description |
---|---|---|
System.String | attributeName | |
System.Boolean | value |
SetAttribute(String, String)
Sets the supplied attribute
Declaration
public void SetAttribute(string name, string value = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | |
System.String | value |
SetIfExists(String, String)
Sets the attribute if it's value exists in the supplied context
Declaration
public void SetIfExists(string attributeName, string attributeValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | attributeName | |
System.String | attributeValue |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
Overrides
System.Object.ToString()
Write(StringBuilder)
Declaration
public void Write(StringBuilder sb)
Parameters
Type | Name | Description |
---|---|---|
System.Text.StringBuilder | sb |