Skip to content

Commit

Permalink
Rename for more semantic sense.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonygiang committed Sep 2, 2021
1 parent f9bdfef commit 6d7d5bc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Attributes/AutoPropertyAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -129,12 +129,12 @@ private static void FillProperty(MyEditor.ObjectField property)
.GetCustomAttributes(typeof(AutoPropertyAttribute), true)
.FirstOrDefault() as AutoPropertyAttribute;
if (apAttribute == null) return;
Func<Object, bool> predicateMethod = (apAttribute.TargetType == null
Func<Object, bool> predicateMethod = (apAttribute.PredicateMethodTarget == null
|| apAttribute.PredicateMethodName == null) ?
_ => true :
(Func<Object, bool>)Delegate.CreateDelegate(
typeof(Func<Object, bool>),
apAttribute.TargetType,
apAttribute.PredicateMethodTarget,
apAttribute.PredicateMethodName);

var matchedObjects = ObjectsGetters[apAttribute.Mode]
Expand Down

0 comments on commit 6d7d5bc

Please sign in to comment.