public HierarchyImplementsIFreezable ( TypeReference typeReference ) : TypeDefinition | ||
typeReference | TypeReference | |
return | TypeDefinition |
public TypeDefinition HierarchyImplementsIFreezable(TypeReference typeReference)
{
TypeDefinition baseType;
var fullName = typeReference.FullName;
if (!typeReferencesImplementingInterface.TryGetValue(fullName, out baseType))
{
var type = ToDefinition(typeReference);
if (ImplementsInterface(type))
{
baseType = type;
}
else if (!ShouldSkipBaseType(type))
{
baseType = HierarchyImplementsIFreezable(type.BaseType);
}
}
return typeReferencesImplementingInterface[fullName] = baseType;
}
public void Execute(List <TypeDefinition> classes) { foreach (var type in classes) { var baseType = implementsInterfaceFinder.HierarchyImplementsIFreezable(type); if (baseType == null) { continue; } var checkMethod = freezeCheckerInjector.Execute(baseType); var typeProcessor = new TypeProcessor(logInfo, checkMethod, type); typeProcessor.Execute(); } }