C# Class CsQuery.Output.FormatDefault

Default output formatter.
Inheritance: IOutputFormatter
Mostrar archivo Open project: prepare/HTML-Renderer Class Usage Examples

Public Methods

Method Description
FormatDefault ( ) : System

Creates the default OutputFormatter using default DomRenderingOption values and default HtmlEncoder

FormatDefault ( DomRenderingOptions options, IHtmlEncoder encoder ) : System

Abstract base class constructor.

Render ( IDomObject node ) : string

Renders the object to a string.

Render ( IDomObject node, TextWriter writer ) : void

Renders the object to the textwriter.

RenderChildren ( IDomObject element, TextWriter writer ) : void

Renders the children of this element.

RenderElement ( IDomObject element, TextWriter writer, bool includeChildren ) : void

Gets the HTML representation of this element and its children.

Protected Methods

Method Description
EndElement ( IDomObject element ) : void

Adds the element close tag to the output stack.

MergeDefaultOptions ( ) : void

Merge options with defaults when needed.

ParseChildren ( IDomObject element ) : void

Renders all the children of the passed node.

RenderAttribute ( TextWriter writer, string name, string value, bool quoteAll ) : void

Render an attribute.

RenderCdataNode ( IDomObject element, TextWriter writer ) : void

Renders a CDATA node.

RenderCommentNode ( IDomObject element, TextWriter writer ) : void

Renders the comment node.

RenderDocTypeNode ( IDomObject element, TextWriter writer ) : void

Renders the document type node.

RenderElementCloseTag ( IDomObject element, TextWriter writer ) : void

Renders the element close tag.

RenderElementInternal ( IDomObject element, TextWriter writer, bool includeChildren ) : void

Gets the HTML representation of this element and its children. (This is the implementation - it will not flush the stack)

RenderElements ( IEnumerable elements, TextWriter writer ) : void

Renders a sequence of elements.

RenderStack ( TextWriter writer ) : void

Process the output stack.

RenderTextNode ( IDomObject textNode, TextWriter writer, bool raw ) : void

Renders the text node.

SetDocType ( IDomObject element ) : void

Sets document type.

Private Methods

Method Description
RenderChildrenInternal ( IDomObject element, TextWriter writer ) : void
RenderInternal ( IDomObject node, TextWriter writer ) : void

Method Details

EndElement() protected method

Adds the element close tag to the output stack.
protected EndElement ( IDomObject element ) : void
element IDomObject /// The element. ///
return void

FormatDefault() public method

Creates the default OutputFormatter using default DomRenderingOption values and default HtmlEncoder
public FormatDefault ( ) : System
return System

FormatDefault() public method

Abstract base class constructor.
public FormatDefault ( DomRenderingOptions options, IHtmlEncoder encoder ) : System
options DomRenderingOptions /// Options for controlling the operation. ///
encoder IHtmlEncoder /// The encoder. ///
return System

MergeDefaultOptions() protected method

Merge options with defaults when needed.
protected MergeDefaultOptions ( ) : void
return void

ParseChildren() protected method

Renders all the children of the passed node.
protected ParseChildren ( IDomObject element ) : void
element IDomObject /// The element. ///
return void

Render() public method

Renders the object to a string.
public Render ( IDomObject node ) : string
node IDomObject /// The node. ///
return string

Render() public method

Renders the object to the textwriter.
/// Thrown when the requested operation is unimplemented. ///
public Render ( IDomObject node, TextWriter writer ) : void
node IDomObject /// The node. ///
writer System.IO.TextWriter /// The writer to which output is written. ///
return void

RenderAttribute() protected method

Render an attribute.
protected RenderAttribute ( TextWriter writer, string name, string value, bool quoteAll ) : void
writer System.IO.TextWriter /// The writer to which output is written. ///
name string /// The name of the attribute. ///
value string /// The attribute value. ///
quoteAll bool /// true to require quotes around the attribute value, false to use quotes only if needed. ///
return void

RenderCdataNode() protected method

Renders a CDATA node.
protected RenderCdataNode ( IDomObject element, TextWriter writer ) : void
element IDomObject /// The element to render ///
writer System.IO.TextWriter /// The writer to which output is written. ///
return void

RenderChildren() public method

Renders the children of this element.
public RenderChildren ( IDomObject element, TextWriter writer ) : void
element IDomObject /// The element to render. ///
writer System.IO.TextWriter /// The writer to which output is written. ///
return void

RenderCommentNode() protected method

Renders the comment node.
protected RenderCommentNode ( IDomObject element, TextWriter writer ) : void
element IDomObject /// The element to render ///
writer System.IO.TextWriter /// The writer to which output is written. ///
return void

RenderDocTypeNode() protected method

Renders the document type node.
protected RenderDocTypeNode ( IDomObject element, TextWriter writer ) : void
element IDomObject /// The element to render ///
writer System.IO.TextWriter /// The writer to which output is written. ///
return void

RenderElement() public method

Gets the HTML representation of this element and its children.
public RenderElement ( IDomObject element, TextWriter writer, bool includeChildren ) : void
element IDomObject /// The element to render. ///
writer System.IO.TextWriter /// The writer to which output is written. ///
includeChildren bool /// true to include, false to exclude the children. ///
return void

RenderElementCloseTag() protected method

Renders the element close tag.
protected RenderElementCloseTag ( IDomObject element, TextWriter writer ) : void
element IDomObject /// The element. ///
writer System.IO.TextWriter /// The writer to which output is written. ///
return void

RenderElementInternal() protected method

Gets the HTML representation of this element and its children. (This is the implementation - it will not flush the stack)
protected RenderElementInternal ( IDomObject element, TextWriter writer, bool includeChildren ) : void
element IDomObject /// The element to render. ///
writer System.IO.TextWriter /// The writer to which output is written. ///
includeChildren bool /// true to include, false to exclude the children. ///
return void

RenderElements() protected method

Renders a sequence of elements.
protected RenderElements ( IEnumerable elements, TextWriter writer ) : void
elements IEnumerable /// The elements. ///
writer System.IO.TextWriter /// The writer to which output is written. ///
return void

RenderStack() protected method

Process the output stack.
/// Thrown when the requested operation is unimplemented. ///
protected RenderStack ( TextWriter writer ) : void
writer System.IO.TextWriter
return void

RenderTextNode() protected method

Renders the text node.
protected RenderTextNode ( IDomObject textNode, TextWriter writer, bool raw ) : void
textNode IDomObject /// The text node. ///
writer System.IO.TextWriter /// The writer to which output is written. ///
raw bool /// true to raw. ///
return void

SetDocType() protected method

Sets document type.
protected SetDocType ( IDomObject element ) : void
element IDomObject /// The element to render. ///
return void