private static ApiInheritanceTreeBuildOutput ResolveInheritanceTree(InheritanceTree tree, string[] supportedLanguages, IReadOnlyDictionary <string, ApiNames> references) { return(new ApiInheritanceTreeBuildOutput { Type = ResolveApiNames(tree.Type, supportedLanguages, references), Inheritance = tree.Inheritance?.Select(item => ResolveInheritanceTree(item, supportedLanguages, references)).ToList(), 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); } }
private static int CalculateInheritanceDepth(InheritanceTree tree) { return(CalculateInheritanceDepth(tree.Inheritance) + 1); }