image.png
INode currentNode = this.keybutton.keyEntry;标签:currentNode,temp,rootTreeNode,writeLog,反向,追加,TreeNode,节点,getNodeLabel From: https://blog.51cto.com/u_15458814/5883897
TreeNode rootTreeNode = null;
while (currentNode != null)
{
//list.AddFirst(currentNode);
LogUtil.writeLog("获取当前:" + currentNode.getNodeLabel());
if (rootTreeNode != null)
{
TreeNode temp = rootTreeNode;
LogUtil.writeLog("操作节点:" + temp.Name);
rootTreeNode = new TreeNode(currentNode.getNodeLabel(), new TreeNode[] { temp });
LogUtil.writeLog("操作节点:" + temp.Name + "追加" + currentNode.getNodeLabel());
}
else
{
rootTreeNode = new TreeNode(currentNode.getNodeLabel());
LogUtil.writeLog("子节点" + currentNode.getNodeLabel());
}
currentNode = currentNode.getParent();
}