using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MyCode.Project.Infrastructure.Trees
{
///
/// 树 生成器
///
public class TreeBuilder
{
///
/// 获取树节点上下文
///
/// 实体类型
/// 输出类型
///
public static ITreeContext Build()
{
return new TreeContext();
}
///
/// 获取树节点上下文
///
/// 实体类型
/// 输出类型
/// 顶级节点显示文本
///
public static ITreeContext Build(string text)
{
var root = new TreeNode(text);
return Build(root);
}
///
/// 获取树节点上下文
///
/// 实体类型
/// 输出类型
/// 顶级节点
///
public static ITreeContext Build(TreeNode rootNode)
{
return new TreeContext(rootNode);
}
///
/// 获取树节点上下文
///
/// 实体类型
///
public static ITreeContext Build()
{
return new TreeContext();
}
///
/// 获取树节点上下文
///
/// 实体类型
/// 顶级节点显示文本
///
public static ITreeContext Build(string text)
{
var root = new TreeNode(text);
return Build(root);
}
///
/// 获取树节点上下文
///
/// 实体类型
/// 顶级节点
///
public static ITreeContext Build(TreeNode rootNode)
{
return new TreeContext(rootNode);
}
}
}