From 6d7d5bc03f3104eb6745216e6a5689d346269671 Mon Sep 17 00:00:00 2001 From: tonygiang Date: Thu, 2 Sep 2021 17:18:11 +0700 Subject: [PATCH] Rename for more semantic sense. --- Attributes/AutoPropertyAttribute.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Attributes/AutoPropertyAttribute.cs b/Attributes/AutoPropertyAttribute.cs index 9ee6916..80b1835 100644 --- a/Attributes/AutoPropertyAttribute.cs +++ b/Attributes/AutoPropertyAttribute.cs @@ -19,15 +19,15 @@ namespace MyBox public class AutoPropertyAttribute : PropertyAttribute { public readonly AutoPropertyMode Mode; - public Type TargetType = null; + public Type PredicateMethodTarget = null; public string PredicateMethodName = null; public AutoPropertyAttribute(AutoPropertyMode mode = AutoPropertyMode.Children, - Type targetType = null, + Type predicateMethodTarget = null, string predicateMethodName = null) { Mode = mode; - TargetType = targetType; + PredicateMethodTarget = predicateMethodTarget; PredicateMethodName = predicateMethodName; } } @@ -129,12 +129,12 @@ private static void FillProperty(MyEditor.ObjectField property) .GetCustomAttributes(typeof(AutoPropertyAttribute), true) .FirstOrDefault() as AutoPropertyAttribute; if (apAttribute == null) return; - Func predicateMethod = (apAttribute.TargetType == null + Func predicateMethod = (apAttribute.PredicateMethodTarget == null || apAttribute.PredicateMethodName == null) ? _ => true : (Func)Delegate.CreateDelegate( typeof(Func), - apAttribute.TargetType, + apAttribute.PredicateMethodTarget, apAttribute.PredicateMethodName); var matchedObjects = ObjectsGetters[apAttribute.Mode]