ImplementsInterfaceFinder.HierarchyImplementsIFreezable C# (CSharp) Méthode

HierarchyImplementsIFreezable() public méthode

public HierarchyImplementsIFreezable ( TypeReference typeReference ) : TypeDefinition
typeReference TypeReference
Résultat 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;
    }

Usage Example

Exemple #1
0
    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();
        }
    }