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;
}
}