void FillTreePathReferences() { foreach (KeyValuePair <int, RootRefInfo> entry in refObjects) { int node = entry.Value.TreeNode; int pobj = entry.Key; foreach (int cn in pathTree.GetChildNodes(node)) { int oref = pathTree.GetNodeObject(cn); ReferenceNode cnode = GetReferenceNode(oref); string fname = map.GetReferencerField(oref, pobj); cnode.AddReference(pobj, oref, cn, entry.Value.References, entry.Value.Memory, fname); } } }
void FindTreeRoot(List <int> path, Dictionary <int, int[]> roots, PathTree pathTree, int node) { int obj = pathTree.GetNodeObject(node); path.Add(obj); bool hasRef = false; foreach (int cnode in pathTree.GetChildNodes(node)) { FindTreeRoot(path, roots, pathTree, cnode); hasRef = true; } if (!hasRef) { // A root RegisterPath(roots, path, obj); } path.RemoveAt(path.Count - 1); }