GetCustomAttributes method can cast attributes

This commit is contained in:
Chris Cameron
2017-10-05 17:16:49 -04:00
parent 3b0bab02de
commit 70c5f817c5

View File

@@ -245,14 +245,14 @@ namespace ICD.Common.Utils
/// <typeparam name="T"></typeparam>
/// <param name="assembly"></param>
/// <returns></returns>
public static IEnumerable<object> GetCustomAttributes<T>(Assembly assembly)
public static IEnumerable<T> GetCustomAttributes<T>(Assembly assembly)
where T : Attribute
{
if (assembly == null)
throw new ArgumentNullException("assembly");
#if SIMPLSHARP
return assembly.GetCustomAttributes(typeof(T), false);
return assembly.GetCustomAttributes(typeof(T), false).Cast<T>();
#else
return assembly.GetCustomAttributes<T>();
#endif