using System; using System.Reflection; namespace Alchemy.Editor { internal static class MemberInfoExtensions { public static bool HasCustomAttribute(this MemberInfo memberInfo) where T : Attribute { return memberInfo.GetCustomAttribute() != null; } public static bool TryGetCustomAttribute(this MemberInfo memberInfo, out T result) where T : Attribute { result = memberInfo.GetCustomAttribute(); return result != null; } } }