Added the settings for #925 but need to apply the settings to the UI

This commit is contained in:
Jamie.Rees 2017-01-13 09:02:53 +00:00
parent 32f044b4da
commit bef6e036f7
10 changed files with 335 additions and 36 deletions

View file

@ -82,6 +82,19 @@ namespace Ombi.Helpers
if (descriptionAttributes == null) return string.Empty;
return (descriptionAttributes.Length > 0) ? descriptionAttributes[0].Name : value.ToString();
}
public static string GetDisplayDescription(T value)
{
var fieldInfo = value.GetType().GetField(value.ToString());
var descriptionAttributes = fieldInfo.GetCustomAttributes(
typeof(DisplayAttribute), false) as DisplayAttribute[];
if (descriptionAttributes[0].ResourceType != null)
return LookupResource(descriptionAttributes[0].ResourceType, descriptionAttributes[0].Description);
if (descriptionAttributes == null) return string.Empty;
return (descriptionAttributes.Length > 0) ? descriptionAttributes[0].Description : value.ToString();
}
public static T GetValueFromName(string name)
{