public TreeNode GetDependenciesFor(ITypeObjectNameKey primitiveTypeKey) { var visitedObjects = new HashSet <ITypeObjectNameKey>(); var root = new TreeNode(primitiveTypeKey, GetDirectDependenciesFor(primitiveTypeKey)); visitedObjects.Add(primitiveTypeKey); GetTreeDependenciesFor(root, visitedObjects); return(root); }
private HashSet <ITypeObjectNameKey> GetDirectDependenciesFor(ITypeObjectNameKey primitiveTypeKey) { var result = new HashSet <ITypeObjectNameKey>(); if (primitiveTypeKey is Field field) { result.AddRange(GetDependenciesFor(field)); } if (primitiveTypeKey is Relation relation) { result.AddRange(GetDependenciesFor(relation)); } if (primitiveTypeKey is RelationField relationField) { result.AddRange(GetDependenciesFor(relationField)); } if (primitiveTypeKey is Procedure procedure) { result.AddRange(GetDependenciesFor(procedure)); } if (primitiveTypeKey is Trigger trigger) { result.AddRange(GetDependenciesFor(trigger)); } if (primitiveTypeKey is DbException dbException) { result.AddRange(GetDependenciesFor(dbException)); } if (primitiveTypeKey is Function function) { result.AddRange(GetDependenciesFor(function)); } if (primitiveTypeKey is Generator generator) { result.AddRange(GetDependenciesFor(generator)); } if (primitiveTypeKey is Index index) { result.AddRange(GetDependenciesFor(index)); } return(result); }
public TreeNode(ITypeObjectNameKey primitiveTypeKey, HashSet <ITypeObjectNameKey> dependencies) { m_PrimitiveTypeKey = primitiveTypeKey; m_Dependencies = dependencies; m_Nodes = new HashSet <TreeNode>(); }