public void ResolveBaseTypes(HierarchyIndex typeIndex) { if (DoNotAddBaseTypes || baseTypes != null) { return; } if (typeIndex == null) { throw new ArgumentNullException(nameof(typeIndex)); } if (baseTypeNames != null && baseTypeNames.Count > 0) { string kindHint = HierarchyIndex.TypeToPrefix <HierarchyInterface> (); foreach (string typeName in baseTypeNames) { HierarchyElement e = typeIndex.Lookup(typeName, kindHint, this); } } AddBaseTypes(typeIndex); if (baseTypes == null) { AddDefaultBaseType(typeIndex); } }
protected virtual void AddBaseTypes(HierarchyIndex typeIndex) { if (typeIndex == null) { throw new ArgumentNullException(nameof(typeIndex)); } }
protected override void AddBaseTypes(HierarchyIndex typeIndex) { base.AddBaseTypes(typeIndex); if (String.IsNullOrEmpty(Extends)) { return; } AddBaseType(Extends); }
void AddDefaultBaseType(HierarchyIndex typeIndex) { string typeName = null; string kindHint = null; if (this is HierarchyInterface) { typeName = Hierarchy.DefaultInterfaceBaseType; kindHint = HierarchyIndex.TypeToPrefix <HierarchyInterface> (); } else if (this is HierarchyClass) { typeName = Hierarchy.DefaultClassBaseType; kindHint = HierarchyIndex.TypeToPrefix <HierarchyClass> (); } else { throw new InvalidOperationException($"Unsupported hierarchy type {GetType ()}"); } AddBaseType(typeName); }