internal IEnumerable <IInheritanceRelationship> GetPathTo(CSharpType parent) { IInheritanceRelationship current = GetImmediateParent(parent); while (true) { yield return(current); if (current.BaseType.IsChildOf(parent)) { current = current.BaseType.GetImmediateParent(parent); } else { break; } } }
public bool IsDirectChildOf(CSharpType methodDeclaringType) { return(BaseTypeRelationships.Any(r => r.BaseType == methodDeclaringType)); }
public IInheritanceRelationship GetImmediateParent(CSharpType targetType) { return(BaseTypeRelationships.First(r => r.BaseType == targetType || r.BaseType.IsChildOf(targetType))); }
public bool IsChildOf(CSharpType targetType) { return(BaseTypeRelationships.Any(r => r.BaseType == targetType || r.BaseType.IsChildOf(targetType))); }
public bool IsParentOf(CSharpType targetType) { return(DerivedTypeRelationships.Any(r => r.DerivedType == targetType || r.DerivedType.IsParentOf(targetType))); }
public abstract IInheritanceRelationship AddBaseType(CSharpType baseTypeDefinition);
public Method(CSharpType declaringType, string methodName, CSharpType returnType) : this(declaringType, methodName, returnType, EmptyParamList) { }
public override IInheritanceRelationship AddBaseType(CSharpType baseTypeDefinition) { return(baseTypeDefinition.AddDerivedClass(this)); }