Catel.Fody.CecilCatelExtensions.DerivesFromType C# (CSharp) Method

DerivesFromType() public static method

public static DerivesFromType ( this typeDefinition, string typeName ) : bool
typeDefinition this
typeName string
return bool
        public static bool DerivesFromType(this TypeDefinition typeDefinition, string typeName)
        {
            if (typeDefinition == null)
            {
                return false;
            }

            var baseType = typeDefinition.BaseType;
            if (baseType == null)
            {
                return false;
            }

            if (baseType.FullName.Contains(typeName))
            {
                return true;
            }

            return false;
        }
    }