Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
 public TreeNode(ITypeObjectNameKey primitiveTypeKey, HashSet <ITypeObjectNameKey> dependencies)
 {
     m_PrimitiveTypeKey = primitiveTypeKey;
     m_Dependencies     = dependencies;
     m_Nodes            = new HashSet <TreeNode>();
 }