Class HtmlTextWriter
Custom implementation of System.Web.UI.HtmlTextWriter to replace it in builds where System.Web is not available.
Implements
Inherited Members
Namespace: System.Web.UI
Assembly: dotNetRdf.dll
Syntax
public class HtmlTextWriter : TextWriter, IDisposable
Remarks
Note that this is not a full implementation of HtmlTextWriter as per the original class, it simply emulates all the functionality that dotNetRDF requires for it's HTML outputting.
Constructors
| Edit this page View SourceHtmlTextWriter(TextWriter)
Creates a new HTML Text Writer.
Declaration
public HtmlTextWriter(TextWriter writer)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | Text Writer. |
Properties
| Edit this page View SourceEncoding
Gets the encoding of the Inner Writer.
Declaration
public override Encoding Encoding { get; }
Property Value
Type | Description |
---|---|
Encoding |
Overrides
| Edit this page View SourceIndent
Gets/Sets the current Indent.
Declaration
public int Indent { get; set; }
Property Value
Type | Description |
---|---|
int |
InnerWriter
Gets the Inner Writer.
Declaration
public TextWriter InnerWriter { get; }
Property Value
Type | Description |
---|---|
TextWriter |
Methods
| Edit this page View SourceAddAttribute(string, string)
Adds an attribute to the next element to be written.
Declaration
public void AddAttribute(string name, string value)
Parameters
Type | Name | Description |
---|---|---|
string | name | Attribute Name. |
string | value | Value. |
AddAttribute(string, string, bool)
Adds an attribute to the next element to be written.
Declaration
public void AddAttribute(string name, string value, bool fEncode)
Parameters
Type | Name | Description |
---|---|---|
string | name | Attribute Name. |
string | value | Value. |
bool | fEncode | Whether to encode the attribute value. |
AddAttribute(HtmlTextWriterAttribute, string)
Adds an attribute to the next element to be written.
Declaration
public void AddAttribute(HtmlTextWriterAttribute key, string value)
Parameters
Type | Name | Description |
---|---|---|
HtmlTextWriterAttribute | key | Attribute. |
string | value | Value. |
AddAttribute(HtmlTextWriterAttribute, string, bool)
Adds an attribute to the next element to be written.
Declaration
public void AddAttribute(HtmlTextWriterAttribute key, string value, bool fEncode)
Parameters
Type | Name | Description |
---|---|---|
HtmlTextWriterAttribute | key | Attribute. |
string | value | Value. |
bool | fEncode | Whether to encode the attribute value. |
AddStyleAttribute(string, string)
Adds a CSS style that will be used in the style attribute of the next element to be written.
Declaration
public void AddStyleAttribute(string name, string value)
Parameters
Type | Name | Description |
---|---|---|
string | name | CSS Attribute Name. |
string | value | Value. |
AddStyleAttribute(HtmlTextWriterStyle, string)
Adds a CSS style that will be used in the style attribute of the next element to be written.
Declaration
public void AddStyleAttribute(HtmlTextWriterStyle key, string value)
Parameters
Type | Name | Description |
---|---|---|
HtmlTextWriterStyle | key | CSS Attribute. |
string | value | Value. |
Close()
Close the writer.
Declaration
public override void Close()
Overrides
| Edit this page View SourceFlush()
Flush the writer.
Declaration
public override void Flush()
Overrides
| Edit this page View SourceRenderBeginTag(string)
Writes the begin tag for an element.
Declaration
public void RenderBeginTag(string tagName)
Parameters
Type | Name | Description |
---|---|---|
string | tagName | Tag Name. |
RenderBeginTag(HtmlTextWriterTag)
Writes the begin tag for an element.
Declaration
public void RenderBeginTag(HtmlTextWriterTag tagKey)
Parameters
Type | Name | Description |
---|---|---|
HtmlTextWriterTag | tagKey | Tag. |
RenderEndTag()
Writes the end tag for an element.
Declaration
public void RenderEndTag()
Write(bool)
Writes a boolean.
Declaration
public override void Write(bool value)
Parameters
Type | Name | Description |
---|---|---|
bool | value | Boolean. |
Overrides
| Edit this page View SourceWrite(char)
Writes a character.
Declaration
public override void Write(char value)
Parameters
Type | Name | Description |
---|---|---|
char | value | Character. |
Overrides
| Edit this page View SourceWrite(char[])
Writes some characters.
Declaration
public override void Write(char[] buffer)
Parameters
Type | Name | Description |
---|---|---|
char[] | buffer | Characters. |
Overrides
| Edit this page View SourceWrite(char[], int, int)
Writes some portion of the given characters.
Declaration
public override void Write(char[] buffer, int index, int count)
Parameters
Type | Name | Description |
---|---|---|
char[] | buffer | Characters. |
int | index | Index to start at. |
int | count | Number of characters to write. |
Overrides
| Edit this page View SourceWrite(decimal)
Writes a decimal.
Declaration
public override void Write(decimal value)
Parameters
Type | Name | Description |
---|---|---|
decimal | value | Decimal. |
Overrides
| Edit this page View SourceWrite(double)
Writes a double.
Declaration
public override void Write(double value)
Parameters
Type | Name | Description |
---|---|---|
double | value | Double. |
Overrides
| Edit this page View SourceWrite(int)
Writes an integer.
Declaration
public override void Write(int value)
Parameters
Type | Name | Description |
---|---|---|
int | value | Integer. |
Overrides
| Edit this page View SourceWrite(long)
Writes a long integer.
Declaration
public override void Write(long value)
Parameters
Type | Name | Description |
---|---|---|
long | value | Long Integer. |
Overrides
| Edit this page View SourceWrite(object)
Writes an object.
Declaration
public override void Write(object value)
Parameters
Type | Name | Description |
---|---|---|
object | value | Object. |
Overrides
| Edit this page View SourceWrite(float)
Writes a float.
Declaration
public override void Write(float value)
Parameters
Type | Name | Description |
---|---|---|
float | value | Float. |
Overrides
| Edit this page View SourceWrite(string)
Writes a string.
Declaration
public override void Write(string value)
Parameters
Type | Name | Description |
---|---|---|
string | value | String. |
Overrides
| Edit this page View SourceWrite(string, object)
Writes a formatted string.
Declaration
public override void Write(string format, object arg0)
Parameters
Type | Name | Description |
---|---|---|
string | format | String with format. |
object | arg0 | Argument to insert into string. |
Overrides
| Edit this page View SourceWrite(string, object, object)
Writes a formatted string.
Declaration
public override void Write(string format, object arg0, object arg1)
Parameters
Type | Name | Description |
---|---|---|
string | format | String with format. |
object | arg0 | Argument to insert into string. |
object | arg1 | Argument to insert into string. |
Overrides
| Edit this page View SourceWrite(string, params object[])
Writes a formatted string.
Declaration
public override void Write(string format, params object[] arg)
Parameters
Type | Name | Description |
---|---|---|
string | format | String with format. |
object[] | arg | Arguments to insert into string. |
Overrides
| Edit this page View SourceWrite(uint)
Writes an unsigned integer.
Declaration
public override void Write(uint value)
Parameters
Type | Name | Description |
---|---|---|
uint | value | Unsigned Integer. |
Overrides
| Edit this page View SourceWrite(ulong)
Writes an unsigned long integer.
Declaration
public override void Write(ulong value)
Parameters
Type | Name | Description |
---|---|---|
ulong | value | Unsigned Long Integer. |
Overrides
| Edit this page View SourceWriteAttribute(string, string)
Writes an attribute.
Declaration
public void WriteAttribute(string name, string value)
Parameters
Type | Name | Description |
---|---|---|
string | name | Attribute Name. |
string | value | Value. |
WriteAttribute(string, string, bool)
Writes an attribute.
Declaration
public void WriteAttribute(string name, string value, bool fEncode)
Parameters
Type | Name | Description |
---|---|---|
string | name | Attribute Name. |
string | value | Value. |
bool | fEncode | Whether to encode the value. |
WriteBeginTag(string)
Writes a begin tag but does not terminate it so that methods like WriteAttribute(string, string) may be used.
Declaration
public void WriteBeginTag(string tagName)
Parameters
Type | Name | Description |
---|---|---|
string | tagName | Tag Name. |
WriteBreak()
Writes a line break.
Declaration
public void WriteBreak()
WriteEncodedText(string)
Writes encoded text.
Declaration
public void WriteEncodedText(string text)
Parameters
Type | Name | Description |
---|---|---|
string | text | Text. |
WriteEncodedUrl(string)
Writes an encoded URL.
Declaration
public void WriteEncodedUrl(string url)
Parameters
Type | Name | Description |
---|---|---|
string | url | URL. |
WriteEncodedUrlParameter(string)
Writes an encoded URL parameter.
Declaration
public void WriteEncodedUrlParameter(string urlText)
Parameters
Type | Name | Description |
---|---|---|
string | urlText | URL parameter. |
WriteEndTag(string)
Writes an end tag.
Declaration
public void WriteEndTag(string tagName)
Parameters
Type | Name | Description |
---|---|---|
string | tagName | Tag Name. |
WriteFullBeginTag(string)
Writes a begin tag with the terminating <, use WriteBeginTag(string) instead if you need to add attributes afterwards.
Declaration
public void WriteFullBeginTag(string tagName)
Parameters
Type | Name | Description |
---|---|---|
string | tagName | Tag Name. |
WriteLine()
Writes a new line.
Declaration
public override void WriteLine()
Overrides
| Edit this page View SourceWriteLine(bool)
Writes a boolean followed by a new line.
Declaration
public override void WriteLine(bool value)
Parameters
Type | Name | Description |
---|---|---|
bool | value | Boolean. |
Overrides
| Edit this page View SourceWriteLine(char)
Writes a character followed by a new line.
Declaration
public override void WriteLine(char value)
Parameters
Type | Name | Description |
---|---|---|
char | value | Character. |
Overrides
| Edit this page View SourceWriteLine(char[])
Writes some characters followed by a new line.
Declaration
public override void WriteLine(char[] buffer)
Parameters
Type | Name | Description |
---|---|---|
char[] | buffer | Characters. |
Overrides
| Edit this page View SourceWriteLine(char[], int, int)
Writes some portion of the characters followed by a new line.
Declaration
public override void WriteLine(char[] buffer, int index, int count)
Parameters
Type | Name | Description |
---|---|---|
char[] | buffer | Characters. |
int | index | Index to start at. |
int | count | Number of characters to write. |
Overrides
| Edit this page View SourceWriteLine(decimal)
Writes a decimal followed by a new line.
Declaration
public override void WriteLine(decimal value)
Parameters
Type | Name | Description |
---|---|---|
decimal | value | Decimal. |
Overrides
| Edit this page View SourceWriteLine(double)
Writes a double followed by a new line.
Declaration
public override void WriteLine(double value)
Parameters
Type | Name | Description |
---|---|---|
double | value | Double. |
Overrides
| Edit this page View SourceWriteLine(int)
Writes an integer followed by a new line.
Declaration
public override void WriteLine(int value)
Parameters
Type | Name | Description |
---|---|---|
int | value | Integer. |
Overrides
| Edit this page View SourceWriteLine(long)
Writes a long integer followed by a new line.
Declaration
public override void WriteLine(long value)
Parameters
Type | Name | Description |
---|---|---|
long | value | Long Integer. |
Overrides
| Edit this page View SourceWriteLine(object)
Writes an object followed by a new line.
Declaration
public override void WriteLine(object value)
Parameters
Type | Name | Description |
---|---|---|
object | value | Object. |
Overrides
| Edit this page View SourceWriteLine(float)
Writes a float followed by a new line.
Declaration
public override void WriteLine(float value)
Parameters
Type | Name | Description |
---|---|---|
float | value | Float. |
Overrides
| Edit this page View SourceWriteLine(string)
Writes a string followed by a new line.
Declaration
public override void WriteLine(string value)
Parameters
Type | Name | Description |
---|---|---|
string | value | String. |
Overrides
| Edit this page View SourceWriteLine(string, object)
Writes a formatted string followed by a new line.
Declaration
public override void WriteLine(string format, object arg0)
Parameters
Type | Name | Description |
---|---|---|
string | format | String. |
object | arg0 | Argument to insert into string. |
Overrides
| Edit this page View SourceWriteLine(string, object, object)
Writes a formatted string followed by a new line.
Declaration
public override void WriteLine(string format, object arg0, object arg1)
Parameters
Type | Name | Description |
---|---|---|
string | format | String. |
object | arg0 | Argument to insert into string. |
object | arg1 | Argument to insert into string. |
Overrides
| Edit this page View SourceWriteLine(string, params object[])
Writes a formatted string followed by a new line.
Declaration
public override void WriteLine(string format, params object[] arg)
Parameters
Type | Name | Description |
---|---|---|
string | format | String. |
object[] | arg | Arguments to insert into string. |
Overrides
| Edit this page View SourceWriteLine(uint)
Writes an unsigned integer followed by a new line.
Declaration
public override void WriteLine(uint value)
Parameters
Type | Name | Description |
---|---|---|
uint | value | Unsigned Integer. |
Overrides
| Edit this page View SourceWriteLine(ulong)
Writes an unsigned long integer followed by a new line.
Declaration
public override void WriteLine(ulong value)
Parameters
Type | Name | Description |
---|---|---|
ulong | value | Unsigned Long Integer. |
Overrides
| Edit this page View SourceWriteLineNoTabs(string)
Writes a string on a line with no tabs.
Declaration
public void WriteLineNoTabs(string s)
Parameters
Type | Name | Description |
---|---|---|
string | s | String. |
WriteStyleAttribute(string, string)
Writes a style attribute.
Declaration
public void WriteStyleAttribute(string name, string value)
Parameters
Type | Name | Description |
---|---|---|
string | name | Attribute Name. |
string | value | Value. |
WriteStyleAttribute(string, string, bool)
Writes a style attribute.
Declaration
public void WriteStyleAttribute(string name, string value, bool fEncode)
Parameters
Type | Name | Description |
---|---|---|
string | name | Attribute Name. |
string | value | Value. |
bool | fEncode | Whether to encode the value. |