Table of Contents

Class ElementSyntax

Namespace
Icy.Design.Syntax
Assembly
IcyUI.Design.dll

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

IReadOnlyList<AttributeSyntax>

Content

Gets the nodes between the start and end tags, in source order, whitespace included.

public IReadOnlyList<MarkupSyntaxNode> Content { get; }

Property Value

IReadOnlyList<MarkupSyntaxNode>

ContentElements

Gets the child elements that are content, excluding property elements.

public IEnumerable<ElementSyntax> ContentElements { get; }

Property Value

IEnumerable<ElementSyntax>

Elements

Gets the child elements, property elements included.

public IEnumerable<ElementSyntax> Elements { get; }

Property Value

IEnumerable<ElementSyntax>

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

TextSpan?

IsMissingEndTag

Gets a value indicating whether the element was never properly closed.

public bool IsMissingEndTag { get; }

Property Value

bool

IsPropertyElement

Gets a value indicating whether this is a property element such as <Grid.RowDefinitions>.

public bool IsPropertyElement { get; }

Property Value

bool

IsSelfClosing

Gets a value indicating whether the element is written as <Name/>.

public bool IsSelfClosing { get; }

Property Value

bool

LocalName

Gets the part of Name after the first :, or the whole name when there is none.

public string LocalName { get; }

Property Value

string

Name

Gets the element's name as written, prefix included (ui:Border, Grid.RowDefinitions).

public string Name { get; }

Property Value

string

NameSpan

Gets the range of the name in the start tag.

public TextSpan NameSpan { get; }

Property Value

TextSpan

Prefix

Gets the part of Name before the first :, or an empty string when there is none.

public string Prefix { get; }

Property Value

string

StartTagEnd

Gets the offset just past the start tag's closing > or />.

public int StartTagEnd { get; }

Property Value

int

StartTagSpan

Gets the range of the start tag.

public TextSpan StartTagSpan { get; }

Property Value

TextSpan

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

name string

The 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

other ElementSyntax

The element to look for.

Returns

bool

true when other is below this element.