1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-22 22:16:13 -04:00
This commit is contained in:
Qstick
2021-08-03 00:43:28 -04:00
committed by Mark McDowall
parent 878d1561aa
commit 1c22a1ec0d
1201 changed files with 5620 additions and 4303 deletions
@@ -29,7 +29,6 @@ namespace NzbDrone.Common.Reflection
type = type.GetGenericArguments()[0];
}
return type.IsPrimitive
|| type.IsEnum
|| type == typeof(string)
@@ -48,7 +47,8 @@ namespace NzbDrone.Common.Reflection
return propertyInfo.CanWrite && propertyInfo.GetSetMethod(false) != null;
}
public static T GetAttribute<T>(this MemberInfo member, bool isRequired = true) where T : Attribute
public static T GetAttribute<T>(this MemberInfo member, bool isRequired = true)
where T : Attribute
{
var attribute = member.GetCustomAttributes(typeof(T), false).SingleOrDefault();
@@ -60,7 +60,8 @@ namespace NzbDrone.Common.Reflection
return (T)attribute;
}
public static T[] GetAttributes<T>(this MemberInfo member) where T : Attribute
public static T[] GetAttributes<T>(this MemberInfo member)
where T : Attribute
{
return member.GetCustomAttributes(typeof(T), false).OfType<T>().ToArray();
}