34 lines
706 B
C#
34 lines
706 B
C#
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Linq;
|
|||
|
|
|
|||
|
|
namespace APT.Infrastructure.Core
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 树结构
|
|||
|
|
/// </summary>
|
|||
|
|
/// <typeparam name="T"></typeparam>
|
|||
|
|
public class TreeNode<T> where T : class
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 节点
|
|||
|
|
/// </summary>
|
|||
|
|
public T Node { get; set; }
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 是否叶子节点
|
|||
|
|
/// </summary>
|
|||
|
|
public bool IsLeaf { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 层级
|
|||
|
|
/// </summary>
|
|||
|
|
public int Level { get; set; }
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 数据集合
|
|||
|
|
/// </summary>
|
|||
|
|
public List<TreeNode<T>> Children { get; set; }
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|