Ejemplo n.º 1
0
 private static ApiInheritanceTreeBuildOutput ResolveInheritanceTree(InheritanceTree tree, string[] supportedLanguages, IReadOnlyDictionary <string, ApiNames> references, int depth, int maxDepth)
 {
     return(new ApiInheritanceTreeBuildOutput
     {
         Type = ResolveApiNames(tree.Type, supportedLanguages, references),
         Inheritance = tree.Inheritance?.Select(item => ResolveInheritanceTree(item, supportedLanguages, references, depth + 1, maxDepth)).ToList(),
         Level = maxDepth - depth - 1,
         Metadata = tree.Metadata
     });
 }
        private IEnumerable <string> GetInheritanceUidReference(InheritanceTree item)
        {
            if (item == null)
            {
                yield break;
            }

            if (item.Inheritance != null)
            {
                foreach (var i in GetInheritanceUidReference(item.Inheritance))
                {
                    yield return(i);
                }
            }
            if (!string.IsNullOrEmpty(item.Type))
            {
                yield return(item.Type);
            }
        }
Ejemplo n.º 3
0
 private static int CalculateInheritanceDepth(InheritanceTree tree)
 {
     return(CalculateInheritanceDepth(tree.Inheritance) + 1);
 }