Antaris.AspNetCore.Mvc.Widgets.Internal.WidgetConventions.IsWidget C# (CSharp) Method

IsWidget() public static method

Determines if the given type represents a widget.
public static IsWidget ( TypeInfo typeInfo ) : bool
typeInfo System.Reflection.TypeInfo The candidate type.
return bool
        public static bool IsWidget(TypeInfo typeInfo)
        {
            if (!typeInfo.IsClass
                || !typeInfo.IsPublic
                || typeInfo.IsAbstract
                || typeInfo.ContainsGenericParameters)
            {
                return false;
            }

            return typeInfo.Name.EndsWith(WidgetSuffix, StringComparison.OrdinalIgnoreCase)
                || typeInfo.GetCustomAttribute<WidgetAttribute>() != null;
        }
    }