Class HtmlTextWriter
Custom implementation of HtmlTextWriter to replace it in builds where System.Web is not available.
Inheritance
System.Object
System.MarshalByRefObject
System.IO.TextWriter
HtmlTextWriter
Implements
System.IDisposable
Inherited Members
System.IO.TextWriter.CoreNewLine
System.IO.TextWriter.Null
System.IO.TextWriter.Dispose()
System.IO.TextWriter.Dispose(System.Boolean)
System.IO.TextWriter.FlushAsync()
System.IO.TextWriter.Synchronized(System.IO.TextWriter)
System.IO.TextWriter.Write(System.String, System.Object, System.Object, System.Object)
System.IO.TextWriter.WriteAsync(System.Char)
System.IO.TextWriter.WriteAsync(System.Char[])
System.IO.TextWriter.WriteAsync(System.Char[], System.Int32, System.Int32)
System.IO.TextWriter.WriteAsync(System.String)
System.IO.TextWriter.WriteLine(System.String, System.Object, System.Object, System.Object)
System.IO.TextWriter.WriteLineAsync()
System.IO.TextWriter.WriteLineAsync(System.Char)
System.IO.TextWriter.WriteLineAsync(System.Char[])
System.IO.TextWriter.WriteLineAsync(System.Char[], System.Int32, System.Int32)
System.IO.TextWriter.WriteLineAsync(System.String)
System.IO.TextWriter.FormatProvider
System.IO.TextWriter.NewLine
System.MarshalByRefObject.GetLifetimeService()
System.MarshalByRefObject.InitializeLifetimeService()
System.MarshalByRefObject.MemberwiseClone(System.Boolean)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
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
| Improve this Doc View SourceHtmlTextWriter(TextWriter)
Creates a new HTML Text Writer.
Declaration
public HtmlTextWriter(TextWriter writer)
Parameters
Type | Name | Description |
---|---|---|
System.IO.TextWriter | writer | Text Writer. |
Properties
| Improve this Doc View SourceEncoding
Gets the encoding of the Inner Writer.
Declaration
public override Encoding Encoding { get; }
Property Value
Type | Description |
---|---|
System.Text.Encoding |
Overrides
System.IO.TextWriter.Encoding
|
Improve this Doc
View Source
Indent
Gets/Sets the current Indent.
Declaration
public int Indent { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
InnerWriter
Gets the Inner Writer.
Declaration
public TextWriter InnerWriter { get; }
Property Value
Type | Description |
---|---|
System.IO.TextWriter |
Methods
| Improve this Doc 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 |
---|---|---|
System.String | name | Attribute Name. |
System.String | value | Value. |
AddAttribute(String, String, Boolean)
Adds an attribute to the next element to be written.
Declaration
public void AddAttribute(string name, string value, bool fEncode)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Attribute Name. |
System.String | value | Value. |
System.Boolean | 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. |
System.String | value | Value. |
AddAttribute(HtmlTextWriterAttribute, String, Boolean)
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. |
System.String | value | Value. |
System.Boolean | 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 |
---|---|---|
System.String | name | CSS Attribute Name. |
System.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. |
System.String | value | Value. |
Close()
Close the writer.
Declaration
public override void Close()
Overrides
System.IO.TextWriter.Close()
|
Improve this Doc
View Source
Flush()
Flush the writer.
Declaration
public override void Flush()
Overrides
System.IO.TextWriter.Flush()
|
Improve this Doc
View Source
RenderBeginTag(String)
Writes the begin tag for an element.
Declaration
public void RenderBeginTag(string tagName)
Parameters
Type | Name | Description |
---|---|---|
System.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(Boolean)
Writes a boolean.
Declaration
public override void Write(bool value)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | value | Boolean. |
Overrides
System.IO.TextWriter.Write(System.Boolean)
|
Improve this Doc
View Source
Write(Char)
Writes a character.
Declaration
public override void Write(char value)
Parameters
Type | Name | Description |
---|---|---|
System.Char | value | Character. |
Overrides
System.IO.TextWriter.Write(System.Char)
|
Improve this Doc
View Source
Write(Char[])
Writes some characters.
Declaration
public override void Write(char[] buffer)
Parameters
Type | Name | Description |
---|---|---|
System.Char[] | buffer | Characters. |
Overrides
System.IO.TextWriter.Write(System.Char[])
|
Improve this Doc
View Source
Write(Char[], Int32, Int32)
Writes some portion of the given characters.
Declaration
public override void Write(char[] buffer, int index, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Char[] | buffer | Characters. |
System.Int32 | index | Index to start at. |
System.Int32 | count | Number of characters to write. |
Overrides
System.IO.TextWriter.Write(System.Char[], System.Int32, System.Int32)
|
Improve this Doc
View Source
Write(Decimal)
Writes a decimal.
Declaration
public override void Write(decimal value)
Parameters
Type | Name | Description |
---|---|---|
System.Decimal | value | Decimal. |
Overrides
System.IO.TextWriter.Write(System.Decimal)
|
Improve this Doc
View Source
Write(Double)
Writes a double.
Declaration
public override void Write(double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | Double. |
Overrides
System.IO.TextWriter.Write(System.Double)
|
Improve this Doc
View Source
Write(Int32)
Writes an integer.
Declaration
public override void Write(int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | Integer. |
Overrides
System.IO.TextWriter.Write(System.Int32)
|
Improve this Doc
View Source
Write(Int64)
Writes a long integer.
Declaration
public override void Write(long value)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | value | Long Integer. |
Overrides
System.IO.TextWriter.Write(System.Int64)
|
Improve this Doc
View Source
Write(Object)
Writes an object.
Declaration
public override void Write(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | Object. |
Overrides
System.IO.TextWriter.Write(System.Object)
|
Improve this Doc
View Source
Write(Single)
Writes a float.
Declaration
public override void Write(float value)
Parameters
Type | Name | Description |
---|---|---|
System.Single | value | Float. |
Overrides
System.IO.TextWriter.Write(System.Single)
|
Improve this Doc
View Source
Write(String)
Writes a string.
Declaration
public override void Write(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | String. |
Overrides
System.IO.TextWriter.Write(System.String)
|
Improve this Doc
View Source
Write(String, Object)
Writes a formatted string.
Declaration
public override void Write(string format, object arg0)
Parameters
Type | Name | Description |
---|---|---|
System.String | format | String with format. |
System.Object | arg0 | Argument to insert into string. |
Overrides
System.IO.TextWriter.Write(System.String, System.Object)
|
Improve this Doc
View Source
Write(String, Object, Object)
Writes a formatted string.
Declaration
public override void Write(string format, object arg0, object arg1)
Parameters
Type | Name | Description |
---|---|---|
System.String | format | String with format. |
System.Object | arg0 | Argument to insert into string. |
System.Object | arg1 | Argument to insert into string. |
Overrides
System.IO.TextWriter.Write(System.String, System.Object, System.Object)
|
Improve this Doc
View Source
Write(String, Object[])
Writes a formatted string.
Declaration
public override void Write(string format, params object[] arg)
Parameters
Type | Name | Description |
---|---|---|
System.String | format | String with format. |
System.Object[] | arg | Arguments to insert into string. |
Overrides
System.IO.TextWriter.Write(System.String, System.Object[])
|
Improve this Doc
View Source
Write(UInt32)
Writes an unsigned integer.
Declaration
public override void Write(uint value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | value | Unsigned Integer. |
Overrides
System.IO.TextWriter.Write(System.UInt32)
|
Improve this Doc
View Source
Write(UInt64)
Writes an unsigned long integer.
Declaration
public override void Write(ulong value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | value | Unsigned Long Integer. |
Overrides
System.IO.TextWriter.Write(System.UInt64)
|
Improve this Doc
View Source
WriteAttribute(String, String)
Writes an attribute.
Declaration
public void WriteAttribute(string name, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Attribute Name. |
System.String | value | Value. |
WriteAttribute(String, String, Boolean)
Writes an attribute.
Declaration
public void WriteAttribute(string name, string value, bool fEncode)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Attribute Name. |
System.String | value | Value. |
System.Boolean | 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 |
---|---|---|
System.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 |
---|---|---|
System.String | text | Text. |
WriteEncodedUrl(String)
Writes an encoded URL.
Declaration
public void WriteEncodedUrl(string url)
Parameters
Type | Name | Description |
---|---|---|
System.String | url | URL. |
WriteEncodedUrlParameter(String)
Writes an encoded URL parameter.
Declaration
public void WriteEncodedUrlParameter(string urlText)
Parameters
Type | Name | Description |
---|---|---|
System.String | urlText | URL parameter. |
WriteEndTag(String)
Writes an end tag.
Declaration
public void WriteEndTag(string tagName)
Parameters
Type | Name | Description |
---|---|---|
System.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 |
---|---|---|
System.String | tagName | Tag Name. |
WriteLine()
Writes a new line.
Declaration
public override void WriteLine()
Overrides
System.IO.TextWriter.WriteLine()
|
Improve this Doc
View Source
WriteLine(Boolean)
Writes a boolean followed by a new line.
Declaration
public override void WriteLine(bool value)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | value | Boolean. |
Overrides
System.IO.TextWriter.WriteLine(System.Boolean)
|
Improve this Doc
View Source
WriteLine(Char)
Writes a character followed by a new line.
Declaration
public override void WriteLine(char value)
Parameters
Type | Name | Description |
---|---|---|
System.Char | value | Character. |
Overrides
System.IO.TextWriter.WriteLine(System.Char)
|
Improve this Doc
View Source
WriteLine(Char[])
Writes some characters followed by a new line.
Declaration
public override void WriteLine(char[] buffer)
Parameters
Type | Name | Description |
---|---|---|
System.Char[] | buffer | Characters. |
Overrides
System.IO.TextWriter.WriteLine(System.Char[])
|
Improve this Doc
View Source
WriteLine(Char[], Int32, Int32)
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 |
---|---|---|
System.Char[] | buffer | Characters. |
System.Int32 | index | Index to start at. |
System.Int32 | count | Number of characters to write. |
Overrides
System.IO.TextWriter.WriteLine(System.Char[], System.Int32, System.Int32)
|
Improve this Doc
View Source
WriteLine(Decimal)
Writes a decimal followed by a new line.
Declaration
public override void WriteLine(decimal value)
Parameters
Type | Name | Description |
---|---|---|
System.Decimal | value | Decimal. |
Overrides
System.IO.TextWriter.WriteLine(System.Decimal)
|
Improve this Doc
View Source
WriteLine(Double)
Writes a double followed by a new line.
Declaration
public override void WriteLine(double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | Double. |
Overrides
System.IO.TextWriter.WriteLine(System.Double)
|
Improve this Doc
View Source
WriteLine(Int32)
Writes an integer followed by a new line.
Declaration
public override void WriteLine(int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | Integer. |
Overrides
System.IO.TextWriter.WriteLine(System.Int32)
|
Improve this Doc
View Source
WriteLine(Int64)
Writes a long integer followed by a new line.
Declaration
public override void WriteLine(long value)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | value | Long Integer. |
Overrides
System.IO.TextWriter.WriteLine(System.Int64)
|
Improve this Doc
View Source
WriteLine(Object)
Writes an object followed by a new line.
Declaration
public override void WriteLine(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | Object. |
Overrides
System.IO.TextWriter.WriteLine(System.Object)
|
Improve this Doc
View Source
WriteLine(Single)
Writes a float followed by a new line.
Declaration
public override void WriteLine(float value)
Parameters
Type | Name | Description |
---|---|---|
System.Single | value | Float. |
Overrides
System.IO.TextWriter.WriteLine(System.Single)
|
Improve this Doc
View Source
WriteLine(String)
Writes a string followed by a new line.
Declaration
public override void WriteLine(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | String. |
Overrides
System.IO.TextWriter.WriteLine(System.String)
|
Improve this Doc
View Source
WriteLine(String, Object)
Writes a formatted string followed by a new line.
Declaration
public override void WriteLine(string format, object arg0)
Parameters
Type | Name | Description |
---|---|---|
System.String | format | String. |
System.Object | arg0 | Argument to insert into string. |
Overrides
System.IO.TextWriter.WriteLine(System.String, System.Object)
|
Improve this Doc
View Source
WriteLine(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 |
---|---|---|
System.String | format | String. |
System.Object | arg0 | Argument to insert into string. |
System.Object | arg1 | Argument to insert into string. |
Overrides
System.IO.TextWriter.WriteLine(System.String, System.Object, System.Object)
|
Improve this Doc
View Source
WriteLine(String, Object[])
Writes a formatted string followed by a new line.
Declaration
public override void WriteLine(string format, params object[] arg)
Parameters
Type | Name | Description |
---|---|---|
System.String | format | String. |
System.Object[] | arg | Arguments to insert into string. |
Overrides
System.IO.TextWriter.WriteLine(System.String, System.Object[])
|
Improve this Doc
View Source
WriteLine(UInt32)
Writes an unsigned integer followed by a new line.
Declaration
public override void WriteLine(uint value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | value | Unsigned Integer. |
Overrides
System.IO.TextWriter.WriteLine(System.UInt32)
|
Improve this Doc
View Source
WriteLine(UInt64)
Writes an unsigned long integer followed by a new line.
Declaration
public override void WriteLine(ulong value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | value | Unsigned Long Integer. |
Overrides
System.IO.TextWriter.WriteLine(System.UInt64)
|
Improve this Doc
View Source
WriteLineNoTabs(String)
Writes a string on a line with no tabs.
Declaration
public void WriteLineNoTabs(string s)
Parameters
Type | Name | Description |
---|---|---|
System.String | s | String. |
WriteStyleAttribute(String, String)
Writes a style attribute.
Declaration
public void WriteStyleAttribute(string name, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Attribute Name. |
System.String | value | Value. |
WriteStyleAttribute(String, String, Boolean)
Writes a style attribute.
Declaration
public void WriteStyleAttribute(string name, string value, bool fEncode)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Attribute Name. |
System.String | value | Value. |
System.Boolean | fEncode | Whether to encode the value. |
Implements
System.IDisposable