private List <TemplateCatalogNode> GetTemplateCatalogTreeInfo() { var results = new List <TemplateCatalogNode>(); if (tv_ConfigTemplateTree.Nodes.Count == 1 && tv_ConfigTemplateTree.Nodes[0].Text == InitialNode) { return(results); } for (int index = 0; index < tv_ConfigTemplateTree.Nodes.Count; index++) { var node = tv_ConfigTemplateTree.Nodes[index]; var childNodeList = new List <TemplateCatalogNode>(); var childSubId = 0; for (int subIndex = 0; subIndex < node.Nodes.Count; subIndex++) { var childNode = new TemplateCatalogNode() { // 节点ID命名101, 102, 103......201, 202, 203 TemplateNodeId = (++childSubId) + 100 * (index + 1), TemplateNodeName = node.Nodes[subIndex].Text, TemplateParentNodeId = index + 1 }; childNodeList.Add(childNode); } var parentNode = new TemplateCatalogNode() { TemplateNodeId = index + 1, TemplateNodeName = node.Text, ChildTemplateNodeList = childNodeList }; results.Add(parentNode); } return(results); }
public LoadTemplateView(TemplateCatalogNode templateCatalog) { this.templateCatalog = templateCatalog; InitializeComponent(); }