public static NamespaceNode FindNamespaceNode(TreeNodeCollection nodes, string namespaceName) { foreach (TreeNode tn in nodes) { NamespaceNode ntn = tn as NamespaceNode; if (ntn == null) { continue; } if (ntn.Namespace == namespaceName) { return(ntn); } } return(null); }
public static TreeNode GetNamespaceNode(TreeNode asmNode, string typedefName) { string[] names = ReportHelper.SplitNamespaces(typedefName); TreeNode parentNode = asmNode; for (int i = 0; i < names.Length - 1; ++i) { NamespaceNode nextNode = FindNamespaceNode(parentNode.Nodes, names[i]); if (nextNode == null) { nextNode = new NamespaceNode(names[i]); parentNode.Nodes.Add(nextNode); } parentNode = nextNode; } return parentNode; }
public static TreeNode GetNamespaceNode(TreeNode asmNode, string typedefName) { string[] names = ReportHelper.SplitNamespaces(typedefName); TreeNode parentNode = asmNode; for (int i = 0; i < names.Length - 1; ++i) { NamespaceNode nextNode = FindNamespaceNode(parentNode.Nodes, names[i]); if (nextNode == null) { nextNode = new NamespaceNode(names[i]); parentNode.Nodes.Add(nextNode); } parentNode = nextNode; } return(parentNode); }