diff --git a/ICD.Common.Utils/AttributeUtils.cs b/ICD.Common.Utils/AttributeUtils.cs index cfefd03..cd83d90 100644 --- a/ICD.Common.Utils/AttributeUtils.cs +++ b/ICD.Common.Utils/AttributeUtils.cs @@ -42,13 +42,42 @@ namespace ICD.Common.Utils if (type == null) throw new ArgumentNullException("type"); -// ReSharper disable InvokeAsExtensionMethod + return GetClassAttributes(type, inherit).FirstOrDefault(); + } + + /// + /// Gets the attributes on the given class type matching the generic type. + /// + /// + /// + /// + public static IEnumerable GetClassAttributes(Type type) + { + if (type == null) + throw new ArgumentNullException("type"); + + return GetClassAttributes(type, false); + } + + /// + /// Gets the attributes on the given class type matching the generic type. + /// + /// + /// + /// + /// + public static IEnumerable GetClassAttributes(Type type, bool inherit) + { + if (type == null) + throw new ArgumentNullException("type"); + + // ReSharper disable InvokeAsExtensionMethod return ReflectionExtensions.GetCustomAttributes( #if SIMPLSHARP - (CType) + (CType) #endif - type, inherit).FirstOrDefault(); -// ReSharper restore InvokeAsExtensionMethod + type, inherit); + // ReSharper restore InvokeAsExtensionMethod } ///