C# 클래스 CsQuery.Implementation.DomObject

Something that appears in the DOM. This is essentially the same as a Node in the browser DOM, but IDomObject represents only things that may appear in the DOM (e.g. not an attribute, document, doctype)
상속: IDomObject, IDomNode
파일 보기 프로젝트 열기: prepare/HTML-Renderer 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
DocInfo DocumentInfo

Private Properties

프로퍼티 타입 설명
ICloneable object
IDomNode IDomNode
Render void
Render void
SetDocFlags void

공개 메소드들

메소드 설명
AddClass ( string className ) : bool

Adds the class.

AddStyle ( string styleString ) : void

Adds a style descriptor to this element, validating the style name and value against the CSS3 ruleset. The string should be of the form "styleName: styleDef;", e.g. "width: 10px;" The trailing semicolon is optional.

AddStyle ( string styleString, bool strict ) : void

Adds a style descriptor to this element, optionally validating against the CSS3 ruleset. The default method always validates; this overload should be used if validation is not desired.

AppendChild ( IDomObject element ) : void

Adds a node to the end of the list of children of a specified parent node. If the node already exists it is removed from current parent node, then added to new parent node.

AppendChildUnsafe ( IDomObject element ) : void

Appends a child without checking to see if its already a member of the DOM. For use in DOM construction to avoid unneeded overhead.

Clone ( ) : IDomObject

Clone this element.

CloneChildren ( ) : IEnumerable

An enumeration of clones of the chilren of this object

CompareTo ( IDomObject other ) : int

Compares this IDomObject object to another to determine their relative ordering.

DescendantCount ( ) : int

Return the total number of descendants of this element.

ElementHtml ( ) : string

Returns the HTML for this element, but ignoring children/innerHTML.

GetAncestors ( ) : IEnumerable

Returns all of the ancestors of the given node, in descending order of their depth from the root node.

GetAttribute ( string name ) : string

Returns the value of the named attribute on the specified element. If the named attribute does not exist, the value returned will either be null or "" (the empty string)

GetAttribute ( string name, string defaultValue ) : string

Returns the value of the named attribute on the specified element. If the named attribute does not exist, the value returned will either be the provide "defaultValue".

GetDescendentElements ( ) : IEnumerable

Returns all IDomElement descendents of the given node, in pre-order depth first order.

GetDescendents ( ) : IEnumerable

Returns all of the descendents of the given node, in pre-order depth first order.

HasAttribute ( string name ) : bool

Returns a boolean value indicating whether the specified element has the specified attribute or not.

HasClass ( string className ) : bool

Returns a boolean value indicating whether the named class exists on this element.

HasStyle ( string styleName ) : bool

Returns a boolean value indicating whether the named style is defined in the styles for this element.

IndexKeys ( ) : IEnumerable

Enumerates index keys in this collection.

IndexKeysRanged ( ) : IEnumerable

Enumerates index keys for this element.

InsertAfter ( IDomObject newNode, IDomObject referenceNode ) : void

Inserts the specified node after a reference element as a child of the current node.

InsertBefore ( IDomObject newNode, IDomObject referenceNode ) : void

Inserts the specified node before a reference element as a child of the current node.

Remove ( ) : void

Removes this object from it's parent, and consequently the Document, if any, to which it belongs.

RemoveAttribute ( string name ) : bool

Removes an attribute from the specified element.

RemoveChild ( IDomObject element ) : void

Removes a child node from the DOM. Returns removed node.

RemoveClass ( string className ) : bool

Removes the named class from the classes defined for this element.

RemoveStyle ( string name ) : bool

Removes the named style from this element.

Render ( ) : string

Renders the complete HTML for this element, including its children.

Render ( DomRenderingOptions options ) : string

Renders the complete HTML for this element, including its children.

Render ( IOutputFormatter formatter ) : string

Renders the complete HTML for this element, including its children, using the specified OutputFormatter.

Render ( IOutputFormatter formatter, TextWriter writer ) : void

Renders the complete HTML for this element, including its children, using the specified OutputFormatter.

SetAttribute ( string name ) : void

Adds a new boolean attribute or sets its value to true.

SetAttribute ( string name, string value ) : void

Adds a new attribute or changes the value of an existing attribute on the specified element.

ToString ( ) : string

The ToString() override for an object depends on the type of element.

TryGetAttribute ( string name, string &value ) : bool

Try to get a named attribute.

this ( int index ) : IDomObject

The child node at the specified index.

this ( string attribute ) : string

The child node at the specified index.

보호된 메소드들

메소드 설명
CloneImplementation ( ) : IDomObject

The implementation for Clone.

GetDepth ( ) : int

Gets the depth of the current node.

GetPath ( ) : ushort[]

Gets the full path to this document.

GetPath_UnOptimized ( ) : ushort[]

Gets the full path to this document.

UpdateDocumentFlags ( ) : void

Updates the cached Document and property flags.

UpdateDocumentFlags ( IDomDocument document ) : void

Updates the cached Document and property flags.

비공개 메소드들

메소드 설명
ICloneable ( ) : object

Makes a deep copy of this object.

IDomNode ( ) : IDomNode

Makes a deep copy of this object.

Render ( StringBuilder sb ) : void
Render ( StringBuilder sb, DomRenderingOptions options ) : void
SetDocFlags ( ) : void

메소드 상세

AddClass() 공개 메소드

Adds the class.
/// Thrown when the requested operation is invalid. ///
public AddClass ( string className ) : bool
className string /// The class name for which to test. ///
리턴 bool

AddStyle() 공개 메소드

Adds a style descriptor to this element, validating the style name and value against the CSS3 ruleset. The string should be of the form "styleName: styleDef;", e.g. "width: 10px;" The trailing semicolon is optional.
/// Thrown when the requested operation is invalid. ///
public AddStyle ( string styleString ) : void
styleString string /// The style string. ///
리턴 void

AddStyle() 공개 메소드

Adds a style descriptor to this element, optionally validating against the CSS3 ruleset. The default method always validates; this overload should be used if validation is not desired.
/// Thrown when the requested operation is invalid. ///
public AddStyle ( string styleString, bool strict ) : void
styleString string /// An object encapsulating the Styles associated with this element. ///
strict bool /// true to enforce validation of CSS3 styles. ///
리턴 void

AppendChild() 공개 메소드

Adds a node to the end of the list of children of a specified parent node. If the node already exists it is removed from current parent node, then added to new parent node.
/// Thrown when the requested operation is invalid. ///
public AppendChild ( IDomObject element ) : void
element IDomObject /// The element to append. ///
리턴 void

AppendChildUnsafe() 공개 메소드

Appends a child without checking to see if its already a member of the DOM. For use in DOM construction to avoid unneeded overhead.
/// Thrown when the requested operation is invalid. ///
public AppendChildUnsafe ( IDomObject element ) : void
element IDomObject /// The element to append. ///
리턴 void

Clone() 공개 메소드

Clone this element.
public Clone ( ) : IDomObject
리턴 IDomObject

CloneChildren() 공개 메소드

An enumeration of clones of the chilren of this object
public CloneChildren ( ) : IEnumerable
리턴 IEnumerable

CloneImplementation() 보호된 추상적인 메소드

The implementation for Clone.
protected abstract CloneImplementation ( ) : IDomObject
리턴 IDomObject

CompareTo() 공개 메소드

Compares this IDomObject object to another to determine their relative ordering.
public CompareTo ( IDomObject other ) : int
other IDomObject /// Another instance to compare. ///
리턴 int

DescendantCount() 공개 메소드

Return the total number of descendants of this element.
public DescendantCount ( ) : int
리턴 int

ElementHtml() 공개 메소드

Returns the HTML for this element, but ignoring children/innerHTML.
public ElementHtml ( ) : string
리턴 string

GetAncestors() 공개 메소드

Returns all of the ancestors of the given node, in descending order of their depth from the root node.
public GetAncestors ( ) : IEnumerable
리턴 IEnumerable

GetAttribute() 공개 메소드

Returns the value of the named attribute on the specified element. If the named attribute does not exist, the value returned will either be null or "" (the empty string)
public GetAttribute ( string name ) : string
name string /// The attribute name. ///
리턴 string

GetAttribute() 공개 메소드

Returns the value of the named attribute on the specified element. If the named attribute does not exist, the value returned will either be the provide "defaultValue".
public GetAttribute ( string name, string defaultValue ) : string
name string /// The attribute name. ///
defaultValue string /// A string to return if the attribute does not exist. ///
리턴 string

GetDepth() 보호된 메소드

Gets the depth of the current node.
protected GetDepth ( ) : int
리턴 int

GetDescendentElements() 공개 메소드

Returns all IDomElement descendents of the given node, in pre-order depth first order.
public GetDescendentElements ( ) : IEnumerable
리턴 IEnumerable

GetDescendents() 공개 메소드

Returns all of the descendents of the given node, in pre-order depth first order.
public GetDescendents ( ) : IEnumerable
리턴 IEnumerable

GetPath() 보호된 메소드

Gets the full path to this document.
protected GetPath ( ) : ushort[]
리턴 ushort[]

GetPath_UnOptimized() 보호된 메소드

Gets the full path to this document.
protected GetPath_UnOptimized ( ) : ushort[]
리턴 ushort[]

HasAttribute() 공개 메소드

Returns a boolean value indicating whether the specified element has the specified attribute or not.
public HasAttribute ( string name ) : bool
name string /// The attribute name. ///
리턴 bool

HasClass() 공개 메소드

Returns a boolean value indicating whether the named class exists on this element.
public HasClass ( string className ) : bool
className string /// The class name for which to test. ///
리턴 bool

HasStyle() 공개 메소드

Returns a boolean value indicating whether the named style is defined in the styles for this element.
public HasStyle ( string styleName ) : bool
styleName string /// Name of the style to test. ///
리턴 bool

IndexKeys() 공개 메소드

Enumerates index keys in this collection.
/// Thrown when the requested operation is invalid. ///
public IndexKeys ( ) : IEnumerable
리턴 IEnumerable

IndexKeysRanged() 공개 메소드

Enumerates index keys for this element.
/// Thrown when the requested operation is not valid for this element type ///
public IndexKeysRanged ( ) : IEnumerable
리턴 IEnumerable

InsertAfter() 공개 메소드

Inserts the specified node after a reference element as a child of the current node.
/// Thrown when the requested operation is invalid. ///
public InsertAfter ( IDomObject newNode, IDomObject referenceNode ) : void
newNode IDomObject /// The new node to be inserted. ///
referenceNode IDomObject /// The node after which the new node will be inserted. ///
리턴 void

InsertBefore() 공개 메소드

Inserts the specified node before a reference element as a child of the current node.
/// Thrown when the requested operation is invalid. ///
public InsertBefore ( IDomObject newNode, IDomObject referenceNode ) : void
newNode IDomObject /// The node to insert. ///
referenceNode IDomObject /// The node before which the new node will be inserted. ///
리턴 void

Remove() 공개 메소드

Removes this object from it's parent, and consequently the Document, if any, to which it belongs.
/// Thrown when the the node has no parent. ///
public Remove ( ) : void
리턴 void

RemoveAttribute() 공개 메소드

Removes an attribute from the specified element.
/// Thrown when the requested operation is invalid. ///
public RemoveAttribute ( string name ) : bool
name string /// The attribute name. ///
리턴 bool

RemoveChild() 공개 메소드

Removes a child node from the DOM. Returns removed node.
/// Thrown when the requested operation is invalid. ///
public RemoveChild ( IDomObject element ) : void
element IDomObject /// The element to remove. ///
리턴 void

RemoveClass() 공개 메소드

Removes the named class from the classes defined for this element.
/// Thrown when the requested operation is invalid. ///
public RemoveClass ( string className ) : bool
className string /// The class name to remove. ///
리턴 bool

RemoveStyle() 공개 메소드

Removes the named style from this element.
/// Thrown when the requested operation is invalid. ///
public RemoveStyle ( string name ) : bool
name string /// The style name. ///
리턴 bool

Render() 공개 메소드

Renders the complete HTML for this element, including its children.
public Render ( ) : string
리턴 string

Render() 공개 메소드

Renders the complete HTML for this element, including its children.
public Render ( DomRenderingOptions options ) : string
options DomRenderingOptions
리턴 string

Render() 공개 메소드

Renders the complete HTML for this element, including its children, using the specified OutputFormatter.
public Render ( IOutputFormatter formatter ) : string
formatter IOutputFormatter /// The formatter. ///
리턴 string

Render() 공개 메소드

Renders the complete HTML for this element, including its children, using the specified OutputFormatter.
public Render ( IOutputFormatter formatter, TextWriter writer ) : void
formatter IOutputFormatter /// The formatter that controls how the ouput is rendered. ///
writer System.IO.TextWriter /// The writer to which output should be written. ///
리턴 void

SetAttribute() 공개 메소드

Adds a new boolean attribute or sets its value to true.
/// Thrown when the object type does not support attributes ///
public SetAttribute ( string name ) : void
name string /// The attribute name. ///
리턴 void

SetAttribute() 공개 메소드

Adds a new attribute or changes the value of an existing attribute on the specified element.
/// Thrown when the object type does not support attributes ///
public SetAttribute ( string name, string value ) : void
name string /// The attribute name. ///
value string /// For input elements, the "value" property of this element. Returns null for other element /// types. ///
리턴 void

ToString() 공개 메소드

The ToString() override for an object depends on the type of element.
public ToString ( ) : string
리턴 string

TryGetAttribute() 공개 메소드

Try to get a named attribute.
public TryGetAttribute ( string name, string &value ) : bool
name string /// The attribute name. ///
value string /// The attribute value, or null if the named attribute does not exist. ///
리턴 bool

UpdateDocumentFlags() 보호된 메소드

Updates the cached Document and property flags.
protected UpdateDocumentFlags ( ) : void
리턴 void

UpdateDocumentFlags() 보호된 메소드

Updates the cached Document and property flags.
protected UpdateDocumentFlags ( IDomDocument document ) : void
document IDomDocument /// A reference to the owning document. This is also the topmost node in the tree. ///
리턴 void

this() 공개 메소드

The child node at the specified index.
public this ( int index ) : IDomObject
index int /// The zero-based index of the child node to access. ///
리턴 IDomObject

this() 공개 메소드

The child node at the specified index.
public this ( string attribute ) : string
attribute string /// The zero-based index of the child node to access. ///
리턴 string

프로퍼티 상세

DocInfo 보호되어 있는 프로퍼티

Information describing metadata about the element's owning document. This is essentially a cache, it prevents us from having to check to see if there's an owning document and access it directly. This is an optimizaton as this happens often.
protected DocumentInfo DocInfo
리턴 DocumentInfo