private static string GetArgumentName(PropertyInfo property) { ArgumentNameAttribute attribute = property.GetCustomAttribute <ArgumentNameAttribute>(); if (IsArrayLike(property)) { Type type = GetArrayLikeElementType(property); return($"{GetArgumentName(type, attribute, "1")} {GetArgumentName(type, attribute, "2")} ..."); } return(GetArgumentName(property.PropertyType, attribute, string.Empty)); }
private static string GetArgumentName(Type type, ArgumentNameAttribute attribute, string suffix) { if (type == typeof(bool)) { return(string.Empty); } if (type.IsEnum) { return(string.Join("|", Enum.GetNames(type))); } if (attribute != null) { return($"<{attribute.Name}{suffix}>"); } return($"<{type.Name}{suffix}>"); }