Applitools.Utils.CommonUtils.GetAttribute C# (CSharp) Method

GetAttribute() public static method

public static GetAttribute ( Enum value ) : TAttribute
value Enum
return TAttribute
        public static TAttribute GetAttribute<TAttribute>(this Enum value) where TAttribute : Attribute
        {
            var enumType = value.GetType();
            var name = Enum.GetName(enumType, value);
            return enumType.GetField(name).GetCustomAttributes(false).OfType<TAttribute>().SingleOrDefault();
        }
        public static TAttribute GetAttribute<TAttribute>(this object value) where TAttribute : Attribute

Same methods

CommonUtils::GetAttribute ( object value ) : TAttribute