public static string GetWidgetFullName(TypeInfo widgetType)
{
if (widgetType == null)
{
throw new ArgumentNullException(nameof(widgetType));
}
var attr = widgetType.GetCustomAttribute<WidgetAttribute>();
if (attr != null && !string.IsNullOrEmpty(attr.Name))
{
return attr.Name;
}
var shortName = GetShortNameByConvention(widgetType);
if (string.IsNullOrEmpty(widgetType.Namespace))
{
return shortName;
}
return $"{widgetType.Namespace}.{shortName}";
}