TreeViewDiagram Class

A tree view: a hierarchy of files and directories drawn as indented rows linked by connector lines, like the output of the tree command, with optional icons and descriptions (Mermaid treeView-beta). As in Mermaid, the tree starts with a root directory named /.

public sealed class TreeViewDiagram : Diagram
Inheritance
Diagram TreeViewDiagram

Constructors

NameDescription
TreeViewDiagram()

TreeViewDiagram()

TreeViewDiagram.cs
public TreeViewDiagram()

No documentation is available.

Properties

NameDescription
DefaultIconPackGets or sets the icon pack of the icon names without a pack, such as material-icon-theme, or null for none.
DescriptionColorGets or sets the color of the descriptions, or null for Mermaid's green.
ExtensionIconsGets the icons of the files by extension, such as .ts (the dot is optional, the case is ignored), used when TreeViewDiagram.ShowIcons is set.
FileNameIconsGets the icons of the files by exact name, used when TreeViewDiagram.ShowIcons is set. The icon none hides the icon.
FontSizeGets or sets the font size of the labels and the descriptions, or null for the font size of the theme.
HighlightBackgroundGets or sets the fill of the rows of the nodes of class highlight, or null for Mermaid's light amber.
HighlightBorderColorGets or sets the border of the rows of the nodes of class highlight, or null for Mermaid's amber.
IconColorGets or sets the color of the icons, or null for Mermaid's gray.
LabelColorGets or sets the color of the labels, or null for the text color of the theme.
LineColorGets or sets the color of the connector lines, or null for the line color of the theme.
LineThicknessGets or sets the thickness of the connector lines, in pixels. The default is 1.
NodesGets the top-level nodes: the children of the root directory.
PaddingXGets or sets the horizontal padding of a row, in pixels. The default is 5.
PaddingYGets or sets the vertical padding of a row, in pixels. The default is 5.
RowIndentGets or sets the indentation of a level, in pixels, added to TreeViewDiagram.PaddingX. The default is 10.
ShowIconsGets or sets a value that indicates whether the nodes without an TreeViewNode.Icon show the built-in file or folder icon, or the icon TreeViewDiagram.FileNameIcons or TreeViewDiagram.ExtensionIcons give them. The default is false.

DefaultIconPack

TreeViewDiagram.cs

Gets or sets the icon pack of the icon names without a pack, such as material-icon-theme, or null for none.

public string? DefaultIconPack { get; set; }

Property value

string?

DescriptionColor

TreeViewDiagram.cs

Gets or sets the color of the descriptions, or null for Mermaid's green.

public SceneColor? DescriptionColor { get; set; }

Property value

SceneColor?

ExtensionIcons

TreeViewDiagram.cs

Gets the icons of the files by extension, such as .ts (the dot is optional, the case is ignored), used when TreeViewDiagram.ShowIcons is set.

public IDictionary<string, string> ExtensionIcons { get; }

FileNameIcons

TreeViewDiagram.cs

Gets the icons of the files by exact name, used when TreeViewDiagram.ShowIcons is set. The icon none hides the icon.

public IDictionary<string, string> FileNameIcons { get; }

Gets or sets the font size of the labels and the descriptions, or null for the font size of the theme.

public double? FontSize { get; set; }

Property value

double?

HighlightBackground

TreeViewDiagram.cs

Gets or sets the fill of the rows of the nodes of class highlight, or null for Mermaid's light amber.

public SceneColor? HighlightBackground { get; set; }

Property value

SceneColor?

HighlightBorderColor

TreeViewDiagram.cs

Gets or sets the border of the rows of the nodes of class highlight, or null for Mermaid's amber.

public SceneColor? HighlightBorderColor { get; set; }

Property value

SceneColor?

Gets or sets the color of the icons, or null for Mermaid's gray.

public SceneColor? IconColor { get; set; }

Property value

SceneColor?

Gets or sets the color of the labels, or null for the text color of the theme.

public SceneColor? LabelColor { get; set; }

Property value

SceneColor?

Gets or sets the color of the connector lines, or null for the line color of the theme.

public SceneColor? LineColor { get; set; }

Property value

SceneColor?

LineThickness

TreeViewDiagram.cs

Gets or sets the thickness of the connector lines, in pixels. The default is 1.

public double LineThickness { get; set; }

Property value

double

Gets the top-level nodes: the children of the root directory.

public IList<TreeViewNode> Nodes { get; }

Property value

IList<TreeViewNode>

Gets or sets the horizontal padding of a row, in pixels. The default is 5.

public double PaddingX { get; set; }

Property value

double

Gets or sets the vertical padding of a row, in pixels. The default is 5.

public double PaddingY { get; set; }

Property value

double

Gets or sets the indentation of a level, in pixels, added to TreeViewDiagram.PaddingX. The default is 10.

public double RowIndent { get; set; }

Property value

double

Gets or sets a value that indicates whether the nodes without an TreeViewNode.Icon show the built-in file or folder icon, or the icon TreeViewDiagram.FileNameIcons or TreeViewDiagram.ExtensionIcons give them. The default is false.

public bool ShowIcons { get; set; }

Property value

bool

Methods

NameDescription
AddNode(string, bool)Adds a top-level node.
EnumerateNodes()Enumerates the nodes and their descendants, depth first, in the order they are drawn.

AddNode(string, bool)

TreeViewDiagram.cs

Adds a top-level node.

public TreeViewNode AddNode(string name, bool isDirectory = false)

Parameters

name string
The name.
isDirectory bool
Whether the node is a directory, drawn in bold.

Returns

TreeViewNode The node.

EnumerateNodes()

TreeViewDiagram.cs

Enumerates the nodes and their descendants, depth first, in the order they are drawn.

public IEnumerable<TreeViewNode> EnumerateNodes()

Returns

IEnumerable<TreeViewNode> The nodes.