Added a release notes page, you can access via Admin>Updates>Recent Changes tab. Note to self, need to put better comments in for users to understand!

This commit is contained in:
Jamie.Rees 2017-03-13 12:28:36 +00:00
commit 2804191781
14 changed files with 451 additions and 70 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 BranchAttribute GetBranchValue<U>(T value) where U : BranchAttribute
{
var fieldInfo = value.GetType().GetField(value.ToString());
var descriptionAttributes = fieldInfo.GetCustomAttributes(
typeof(BranchAttribute), false) as BranchAttribute[];
return descriptionAttributes?.FirstOrDefault();
}
public static string GetDisplayDescription(T value)
{
var fieldInfo = value.GetType().GetField(value.ToString());
@ -127,4 +140,9 @@ namespace Ombi.Helpers
return Enum.GetValues(typeof(T)).Cast<int>().Sum();
}
}
public class BranchAttribute : Attribute
{
public string DisplayName { get; set; }
public string BranchName { get; set; }
}
}