|
@@ -60,10 +60,15 @@ namespace InABox.Core
|
|
|
Func<object, object> Getter();
|
|
|
|
|
|
Action<object, object> Setter();
|
|
|
+
|
|
|
+ TAttribute? GetAttribute<TAttribute>() where TAttribute : Attribute;
|
|
|
}
|
|
|
|
|
|
public static class PropertyExtensions
|
|
|
{
|
|
|
+ public static bool HasAttribute<TAttribute>(this IProperty property) where TAttribute : Attribute
|
|
|
+ => property.GetAttribute<TAttribute>() != null;
|
|
|
+
|
|
|
public static IProperty? GetParentWithEditor(this IProperty property)
|
|
|
{
|
|
|
if (property.Parent == null) return null;
|