[Category(CategoryName.OPTIONS)]
[Description("获取节点的所有子节点")]
[TypeConverter(typeof(StringArrayConverter))]
public TreeNode[] NodesAllChild
{
get
{
return GetAllChildNodes(this);
}
}
private ExtAspNet.TreeNode[] GetAllChildNodes(ExtAspNet.TreeNode node)
{
List<ExtAspNet.TreeNode> ltNode = new List<ExtAspNet.TreeNode>();
if (node.Nodes.Count > 0)
{
foreach (ExtAspNet.TreeNode subNode in node.Nodes)
{
ltNode.Add(subNode);
ltNode.AddRange(GetAllChildNodes(subNode));
}
}
return ltNode.ToArray();
}
[Category(CategoryName.OPTIONS)]
[Description("获取节点的所有子节点(含自身节点)")]
[TypeConverter(typeof(StringArrayConverter))]
public string[] NodesIdAllChild
{
get
{
List<string> s = new List<string>();
s.Add(this.NodeID);
foreach (TreeNode tn in NodesAllChild)
{
s.Add(tn.NodeID);
}