private void GenerateNodes(Tunnel tunnel, StandardDef Standard) { List <TreeNode> nodes = new List <TreeNode>(); int index = 0; foreach (Stage stage in tunnel.Stages) { TreeNode stageTreeNode = new TreeNode() { NodeID = index++, Level = 1, Context = stage.LangStr, isExpanded = true }; foreach (Category category in stage.Categories) { TreeNode categoryTreeNode = new TreeNode() { NodeID = index++, Level = 2, Context = category.LangStr, isExpanded = true }; foreach (string obj in category.objList) { DGObjectDef dGObject = Standard.GetDGObjectDefByCode(obj); TreeNode objTreeNode = new TreeNode() { NodeID = index++, Level = 3, Context = dGObject.LangStr }; categoryTreeNode.ChildNodes.Add(objTreeNode); } stageTreeNode.ChildNodes.Add(categoryTreeNode); } nodes.Add(stageTreeNode); } TreeNodes = nodes; }
private void Filter2Standard(Category category, ref StandardDef standardDef, StandardDef dataStandard) { DomainDef domain = new DomainDef() { Code = category.CategoryName, LangStr = category.LangStr }; foreach (string obj in category.objList) { DGObjectDef objectDef = dataStandard.GetDGObjectDefByCode(obj); domain.DGObjectContainer.Add(objectDef); } standardDef.DomainContainer.Add(domain); }