Class ElementSyntax
An element: its start tag with attributes, its content, and its end tag.
public sealed class ElementSyntax : MarkupSyntaxNode
- Inheritance
-
ElementSyntax
- Inherited Members
- Extension Methods
Properties
Attributes
Gets the attributes, in source order.
public IReadOnlyList<AttributeSyntax> Attributes { get; }
Property Value
Content
Gets the nodes between the start and end tags, in source order, whitespace included.
public IReadOnlyList<MarkupSyntaxNode> Content { get; }
Property Value
ContentElements
Gets the child elements that are content, excluding property elements.
public IEnumerable<ElementSyntax> ContentElements { get; }
Property Value
Elements
Gets the child elements, property elements included.
public IEnumerable<ElementSyntax> Elements { get; }
Property Value
EndTagSpan
Gets the range of the end tag, or null for a self-closing element or one whose end tag is missing.
public TextSpan? EndTagSpan { get; }
Property Value
IsMissingEndTag
Gets a value indicating whether the element was never properly closed.
public bool IsMissingEndTag { get; }
Property Value
IsPropertyElement
Gets a value indicating whether this is a property element such as <Grid.RowDefinitions>.
public bool IsPropertyElement { get; }
Property Value
IsSelfClosing
Gets a value indicating whether the element is written as <Name/>.
public bool IsSelfClosing { get; }
Property Value
LocalName
Gets the part of Name after the first :, or the whole name when there is none.
public string LocalName { get; }
Property Value
Name
Gets the element's name as written, prefix included (ui:Border, Grid.RowDefinitions).
public string Name { get; }
Property Value
NameSpan
Gets the range of the name in the start tag.
public TextSpan NameSpan { get; }
Property Value
Prefix
Gets the part of Name before the first :, or an empty string when there is none.
public string Prefix { get; }
Property Value
StartTagEnd
Gets the offset just past the start tag's closing > or />.
public int StartTagEnd { get; }
Property Value
StartTagSpan
Gets the range of the start tag.
public TextSpan StartTagSpan { get; }
Property Value
Methods
DescendantsAndSelf()
Enumerates this element and every element below it, in document order.
public IEnumerable<ElementSyntax> DescendantsAndSelf()
Returns
- IEnumerable<ElementSyntax>
The elements, this one first.
FindAttribute(string)
Finds an attribute by its name as written.
public AttributeSyntax? FindAttribute(string name)
Parameters
namestringThe attribute name, prefix included.
Returns
- AttributeSyntax
The attribute, or null when the element has none of that name.
IsAncestorOf(ElementSyntax)
Determines whether this element contains other at any depth.
public bool IsAncestorOf(ElementSyntax other)
Parameters
otherElementSyntaxThe element to look for.