C# 클래스 Microsoft.Html.Core.Tree.Nodes.ElementNode

Represent HTML element node in the tree
상속: TreeNode, ICompositeTextRange, IHtmlTreeVisitorPattern, IPropertyOwner
파일 보기 프로젝트 열기: Microsoft/RTVS 1 사용 예제들

공개 메소드들

메소드 설명
Accept ( Func visitor, object parameter ) : bool
Accept ( IHtmlTreeVisitor visitor, object parameter ) : bool
AddOrphanedEndTag ( TagNode tag ) : void
Contains ( ITextRange range, bool inclusiveTagStart, bool inclusiveTagEnd ) : bool
Contains ( int position ) : bool

Determines if element contains given position

ElementEnclosingRange ( ITextRange range, bool inclusiveEnd ) : ElementNode

Finds deepest element node which inner range fully encloses given positions

ElementFromPosition ( int pos ) : ElementNode

Finds deepest element node that contains given position

ElementFromRange ( ITextRange range ) : ElementNode

Finds deepest element node that fully encloses given range

ElementFromRangeAndInclusion ( ITextRange range, bool inclusiveTagStart, bool inclusiveTagEnd ) : ElementNode
ElementNode ( ElementNode parent, int openAngleBracketPosition, NameToken nameToken, int maxEnd ) : System
GetAttribute ( string attributeName ) : AttributeNode

Locates element attribute by name using string comparison as specified by tree the element is in.

GetAttribute ( string attributeName, bool ignoreCase ) : AttributeNode

Locates element attribute by name

GetAttribute ( string prefix, string attributeName, bool ignoreCase ) : AttributeNode

Locates element attribute by prefix and name

GetAttributeIndex ( string attributeName, bool ignoreCase ) : int

Locates element attribute by name

GetChildrenSurroundingRange ( ITextRange range, int &child1, int &child2 ) : void

Given text range locates previous and next child nodes that surround the range

GetCommonAncestor ( ElementNode node1, ElementNode node2 ) : ElementNode

Retrieves node that contains both node1 and node2 ranges. Node1 range must precede node2 in the text buffer

GetPositionElement ( int position, ElementNode &element, AttributeNode &attribute ) : HtmlPositionType

Determines position type and enclosing element node for a given position in the document text.

GetText ( ITextRange range ) : string
HasPrefix ( ) : bool
IsDocType ( ) : bool

Determines if element is a DOCTYPE element

IsScriptBlock ( ) : bool

Determines if element is a script block

IsSelfClosing ( ) : bool

Tells if element is self-closing element like <br>. Does not tell if element is closed by />, use IsShortHand for that.

IsShorthand ( ) : bool

Tells if element is a short-hand element ending in />

IsStyleBlock ( ) : bool

Determines if element is a style block

RemoveChild ( int index ) : void
RemoveChildren ( int start, int count ) : void
Shift ( int offset ) : void

Shifts node start, end and all child elements by the specified offset.

ShiftStartingFrom ( int start, int offset ) : void

Shifts node components that are located at or beyond given start point by the specified range

비공개 메소드들

메소드 설명
CompleteElement ( ITextRange closingSequence, bool isClosed, ReadOnlyCollection children, ReadOnlyCollection startTagAtributes, ReadOnlyCollection endTagAttributes ) : void

Completes element. Called by tree builder when element is complete: start tag is self-closed or implicitly closed or element is closed by a well-formed end tag or by another tag that is being opened.

FindTopmostParent ( List tagNames, bool ignoreCase ) : ElementNode

Given list of end tag names finds topmost element that matches provided end tags

OpenEndTag ( int position, NameToken nameToken, int maxEnd ) : void

Begins element end tag processing. Called exclusively by tree builder. when it discovers </name sequence.

ToString ( ) : string

메소드 상세

Accept() 공개 메소드

public Accept ( Func visitor, object parameter ) : bool
visitor Func
parameter object
리턴 bool

Accept() 공개 메소드

public Accept ( IHtmlTreeVisitor visitor, object parameter ) : bool
visitor IHtmlTreeVisitor
parameter object
리턴 bool

AddOrphanedEndTag() 공개 메소드

public AddOrphanedEndTag ( TagNode tag ) : void
tag TagNode
리턴 void

Contains() 공개 메소드

public Contains ( ITextRange range, bool inclusiveTagStart, bool inclusiveTagEnd ) : bool
range ITextRange
inclusiveTagStart bool
inclusiveTagEnd bool
리턴 bool

Contains() 공개 메소드

Determines if element contains given position
public Contains ( int position ) : bool
position int Position in a text buffer
리턴 bool

ElementEnclosingRange() 공개 메소드

Finds deepest element node which inner range fully encloses given positions
public ElementEnclosingRange ( ITextRange range, bool inclusiveEnd ) : ElementNode
range ITextRange Range to analyze
inclusiveEnd bool If true, element and range may have same end points
리턴 ElementNode

ElementFromPosition() 공개 메소드

Finds deepest element node that contains given position
public ElementFromPosition ( int pos ) : ElementNode
pos int Position
리턴 ElementNode

ElementFromRange() 공개 메소드

Finds deepest element node that fully encloses given range
public ElementFromRange ( ITextRange range ) : ElementNode
range ITextRange
리턴 ElementNode

ElementFromRangeAndInclusion() 공개 메소드

public ElementFromRangeAndInclusion ( ITextRange range, bool inclusiveTagStart, bool inclusiveTagEnd ) : ElementNode
range ITextRange
inclusiveTagStart bool
inclusiveTagEnd bool
리턴 ElementNode

ElementNode() 공개 메소드

public ElementNode ( ElementNode parent, int openAngleBracketPosition, NameToken nameToken, int maxEnd ) : System
parent ElementNode
openAngleBracketPosition int
nameToken Microsoft.Html.Core.Parser.Tokens.NameToken
maxEnd int
리턴 System

GetAttribute() 공개 메소드

Locates element attribute by name using string comparison as specified by tree the element is in.
public GetAttribute ( string attributeName ) : AttributeNode
attributeName string Fully qualified attribute name
리턴 AttributeNode

GetAttribute() 공개 메소드

Locates element attribute by name
public GetAttribute ( string attributeName, bool ignoreCase ) : AttributeNode
attributeName string Fully qualified attribute name
ignoreCase bool True if comparison should be case-insensitive
리턴 AttributeNode

GetAttribute() 공개 메소드

Locates element attribute by prefix and name
public GetAttribute ( string prefix, string attributeName, bool ignoreCase ) : AttributeNode
prefix string Namespace prefix
attributeName string Attribute name
ignoreCase bool True if comparison should be case-insensitive
리턴 AttributeNode

GetAttributeIndex() 공개 메소드

Locates element attribute by name
public GetAttributeIndex ( string attributeName, bool ignoreCase ) : int
attributeName string Fully qualified attribute name
ignoreCase bool True if comparison should be case-insensitive
리턴 int

GetChildrenSurroundingRange() 공개 메소드

Given text range locates previous and next child nodes that surround the range
public GetChildrenSurroundingRange ( ITextRange range, int &child1, int &child2 ) : void
range ITextRange Text range
child1 int Index of the child node that precedes start of the range
child2 int Index of the child that follows end of the range
리턴 void

GetCommonAncestor() 공개 메소드

Retrieves node that contains both node1 and node2 ranges. Node1 range must precede node2 in the text buffer
public GetCommonAncestor ( ElementNode node1, ElementNode node2 ) : ElementNode
node1 ElementNode First node
node2 ElementNode Second node
리턴 ElementNode

GetPositionElement() 공개 메소드

Determines position type and enclosing element node for a given position in the document text.
public GetPositionElement ( int position, ElementNode &element, AttributeNode &attribute ) : HtmlPositionType
position int Position in the document text
element ElementNode Element that contains position
attribute AttributeNode Attribute that contains position (may be null)
리턴 HtmlPositionType

GetText() 공개 메소드

public GetText ( ITextRange range ) : string
range ITextRange
리턴 string

HasPrefix() 공개 메소드

public HasPrefix ( ) : bool
리턴 bool

IsDocType() 공개 메소드

Determines if element is a DOCTYPE element
public IsDocType ( ) : bool
리턴 bool

IsScriptBlock() 공개 메소드

Determines if element is a script block
public IsScriptBlock ( ) : bool
리턴 bool

IsSelfClosing() 공개 메소드

Tells if element is self-closing element like <br>. Does not tell if element is closed by />, use IsShortHand for that.
public IsSelfClosing ( ) : bool
리턴 bool

IsShorthand() 공개 메소드

Tells if element is a short-hand element ending in />
public IsShorthand ( ) : bool
리턴 bool

IsStyleBlock() 공개 메소드

Determines if element is a style block
public IsStyleBlock ( ) : bool
리턴 bool

RemoveChild() 공개 메소드

public RemoveChild ( int index ) : void
index int
리턴 void

RemoveChildren() 공개 메소드

public RemoveChildren ( int start, int count ) : void
start int
count int
리턴 void

Shift() 공개 메소드

Shifts node start, end and all child elements by the specified offset.
public Shift ( int offset ) : void
offset int
리턴 void

ShiftStartingFrom() 공개 메소드

Shifts node components that are located at or beyond given start point by the specified range
public ShiftStartingFrom ( int start, int offset ) : void
start int Start point
offset int Offset to shift by
리턴 void