Class TreeRootNode
A tree node that represents various types of root nodes
Namespace: Umbraco.Cms.Core.Models.Trees
Assembly: Umbraco.Infrastructure.dll
Syntax
[DataContract(Name = "node", Namespace = "")]
public sealed class TreeRootNode : TreeNode
Remarks
A TreeRootNode represents: * The root node for a section containing a single tree * The root node for a section containing multiple sub-trees * The root node for a section containing groups of multiple sub-trees * The group node in a section containing groups of multiple sub-trees
This is required to return the tree data for a given section. Some sections may only contain one tree which means it's section root should also display a menu, whereas other sections have multiple trees and the section root shouldn't display a menu.
The root node also contains an explicit collection of children.
Properties
View SourceChildren
The node's children collection
Declaration
[DataMember(Name = "children")]
public TreeNodeCollection Children { get; }
Property Value
Type | Description |
---|---|
TreeNodeCollection |
ContainsGroups
True if this root node contains group root nodes
Declaration
[DataMember(Name = "containsGroups")]
public bool ContainsGroups { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
ContainsTrees
Returns true if there are any children
Declaration
[DataMember(Name = "containsTrees")]
public bool ContainsTrees { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
This is used in the UI to configure a full screen section/app
IsContainer
Will be true if this is a multi-tree section root node (i.e. contains other trees)
Declaration
[DataMember(Name = "isContainer")]
public bool IsContainer { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsGroup
True if this is a group root node
Declaration
[DataMember(Name = "isGroup")]
public bool IsGroup { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
View SourceCreateGroupedMultiTreeRoot(TreeNodeCollection)
Creates a section root node for grouped multiple trees
Declaration
public static TreeRootNode CreateGroupedMultiTreeRoot(TreeNodeCollection children)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeCollection | children |
Returns
Type | Description |
---|---|
TreeRootNode |
CreateGroupNode(TreeNodeCollection, String)
Creates a group node for grouped multiple trees
Declaration
public static TreeRootNode CreateGroupNode(TreeNodeCollection children, string section)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeCollection | children | |
System.String | section |
Returns
Type | Description |
---|---|
TreeRootNode |
CreateMultiTreeRoot(TreeNodeCollection)
Creates a section root node for non-grouped multiple trees
Declaration
public static TreeRootNode CreateMultiTreeRoot(TreeNodeCollection children)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeCollection | children |
Returns
Type | Description |
---|---|
TreeRootNode |
CreateSingleTreeRoot(String, String, String, String, TreeNodeCollection, Boolean)
Creates a section root node for a section with a single tree
Declaration
public static TreeRootNode CreateSingleTreeRoot(string nodeId, string getChildNodesUrl, string menuUrl, string title, TreeNodeCollection children, bool isSingleNodeTree = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | nodeId | |
System.String | getChildNodesUrl | |
System.String | menuUrl | |
System.String | title | |
TreeNodeCollection | children | |
System.Boolean | isSingleNodeTree |
Returns
Type | Description |
---|---|
TreeRootNode |